summaryrefslogtreecommitdiffstats
path: root/src/angular/form-elements/dropdown/dropdown-trigger.directive.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/angular/form-elements/dropdown/dropdown-trigger.directive.ts')
-rw-r--r--src/angular/form-elements/dropdown/dropdown-trigger.directive.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/angular/form-elements/dropdown/dropdown-trigger.directive.ts b/src/angular/form-elements/dropdown/dropdown-trigger.directive.ts
new file mode 100644
index 0000000..94ab3bc
--- /dev/null
+++ b/src/angular/form-elements/dropdown/dropdown-trigger.directive.ts
@@ -0,0 +1,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);
+ }
+
+}