Add KeyboardButtonGroup Component
This commit is contained in:
34
src/components/keyboard-button-group.component.ts
Normal file
34
src/components/keyboard-button-group.component.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { Component, OnInit, Input } from 'angular2/core';
|
||||||
|
|
||||||
|
import {KeyboardButtonComponent} from './keyboard-button.component';
|
||||||
|
import {KeyboardButton} from './keyboard-button.model';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'keyboard-button-group',
|
||||||
|
template:
|
||||||
|
`
|
||||||
|
<keyboard-button *ngFor="#keyboardButton of keyboardButtons"
|
||||||
|
[id]="keyboardButton.id" [fill]="keyboardButton.fill"
|
||||||
|
[rx]="keyboardButton.rx" [ry]="keyboardButton.ry"
|
||||||
|
[height]="keyboardButton.height" [width]="keyboardButton.width">
|
||||||
|
</keyboard-button>
|
||||||
|
`,
|
||||||
|
styles:
|
||||||
|
[`
|
||||||
|
:host {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
keyboard-button {
|
||||||
|
border: 2px solid transparent;
|
||||||
|
}
|
||||||
|
`],
|
||||||
|
directives: [KeyboardButtonComponent]
|
||||||
|
})
|
||||||
|
export class KeyboardButtonGroupComponent implements OnInit {
|
||||||
|
@Input() keyboardButtons: KeyboardButton[];
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() { }
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user