feat(aio): expand nav menu branch of select item on page load

This commit is contained in:
Ward Bell 2017-03-17 21:48:20 -07:00 committed by Miško Hevery
parent 64beae9527
commit a13ddf2e8a
1 changed files with 1 additions and 0 deletions

View File

@ -17,6 +17,7 @@ export class NavItemComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if (changes['selectedNodes'] || changes['node']) { if (changes['selectedNodes'] || changes['node']) {
this.isSelected = this.selectedNodes.indexOf(this.node) !== -1; this.isSelected = this.selectedNodes.indexOf(this.node) !== -1;
this.isExpanded = this.isExpanded || this.isSelected;
} }
this.setClasses(); this.setClasses();
} }