import { Directive , HostListener , Input } from '@angular/core' ; import { MenuController } from '../app/menu-controller' ; name description usage demo see {@link /docs/components#menus Menu Component Docs} see {@link ../../menu/Menu Menu API Docs} @ Directive ( { selector : '[menuClose]' } ) export class MenuClose { hidden @ Input ( ) menuClose : string ; constructor ( private _menu ) { } hidden @ HostListener ( 'click' ) close ( ) { const menu = this . _menu . get ( this . menuClose ) ; menu && menu . close ( ) ; } }