Fix tslint and related errors.

This commit is contained in:
József Farkas
2016-04-13 21:30:55 +02:00
parent 9b040c6665
commit 5542b66871
10 changed files with 26 additions and 25 deletions

View File

@@ -30,27 +30,25 @@ export class ModuleComponent implements OnInit {
ngOnInit() {
this.getButtonGroups().forEach(buttonGroup => {
this.dcl.loadIntoLocation(KeyboardButtonGroupComponent, this.elementRef, "row").then((bttnComponentRef: ComponentRef) => {
var group: KeyboardButtonGroupComponent = bttnComponentRef.instance;
group.keyboardButtons = buttonGroup;
// console.log(keyboardButtonComponent);
});
this.dcl.loadIntoLocation(KeyboardButtonGroupComponent, this.elementRef, 'row')
.then((bttnComponentRef: ComponentRef) => {
let group: KeyboardButtonGroupComponent = bttnComponentRef.instance;
group.keyboardButtons = buttonGroup;
});
});
}
private getButtonGroups(): KeyboardButton[][] {
var buttonGroups: KeyboardButton[][] = [];
var buttonGroup: KeyboardButton[] = [];
this.keyboardButtons.forEach((keyboardButton, index) => {
let buttonGroups: KeyboardButton[][] = [];
let buttonGroup: KeyboardButton[] = [];
this.keyboardButtons.forEach(keyboardButton => {
if (buttonGroup.length > 0 && buttonGroup[buttonGroup.length - 1].y !== keyboardButton.y) {
buttonGroups.push(buttonGroup);
buttonGroup = [];
}
buttonGroup.push(keyboardButton);
});
//console.log(buttonGroups, buttonGroup, this.keyboardButtons);
return buttonGroups;
}
}
}