summaryrefslogtreecommitdiffstats
path: root/src/angular/form-elements/dropdown/dropdown-trigger.directive.ts
blob: 94ab3bc6f00e3d6b5ecd3a5fe40bf7a99a1726a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Directive, Input, HostBinding, HostListener } from "@angular/core";
import { DropDownComponent } from "./dropdown.component";

@Directive({
    selector: '[SdcDropdownTrigger]'
})

export class DropDownTriggerDirective {

    @HostBinding('class.js-sdc-dropdown--toggle-hook') true;
    @Input() dropDown: DropDownComponent;

    @HostListener('click', ['$event']) onClick = (event) => {
        this.dropDown.toggleDropdown(event);
    }

}