@Component({
selector: 'nb-dropdown',
template: `
<div class="dropdown"
[class.open]="isOpen"
(click)="isOpen = !isOpen">
<button>
<ng-container
[ngTemplateOutlet]="match.tpl"
[ngOutletContext]="selected">
</ng-container>
<span *ngIf="!selected.$implicit">{{placeholder}}</span>
</button>
<ul>
<li *ngFor="let option of nbSelectOptions">
<a href="#">
<ng-container [ngTemplateOutlet]="option.tpl">
</ng-container>
</a>
</li>
</ul>
</div>
`,
})
export class NbDropdownComponent {
@Input() placeholder;
@ContentChild(NbSelectMatchDirective) match;
@ContentChildren(NbSelectOptionDirective) nbSelectOptions;
selected = {};
}