UNPKG

ng2-encrm-components

Version:
23 lines (19 loc) 660 B
import { Component } from '@angular/core'; @Component({ selector: 'dropdowns-preview', template: require('./dropdowns-preview.component.html') }) export class DropdownsPreviewComponent { public disabled: boolean = false; public status: {isopen: boolean} = {isopen: false}; public items: Array<string> = ['The first choice!', 'And another choice for you.', 'but wait! A third!']; public toggled(open: boolean): void { console.log('Dropdown is now: ', open); } public toggleDropdown($event: MouseEvent): void { $event.preventDefault(); $event.stopPropagation(); this.status.isopen = !this.status.isopen; } }