You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
283 B

  1. import { Directive, HostListener, HostBinding } from "@angular/core";
  2. @Directive({
  3. selector: '[appDropdown]'
  4. })
  5. export class DropdownDirective {
  6. @HostBinding('class.open') isOpen = false;
  7. @HostListener('click') toggleOpen() {
  8. this.isOpen = !this.isOpen;
  9. }
  10. }