a zip code crypto-currency system good for red ONLY

menu-close.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { Directive, HostListener, Input } from '@angular/core';
  2. import { MenuController } from '../app/menu-controller';
  3. /**
  4. * @name MenuClose
  5. * @description
  6. * The `menuClose` directive can be placed on any button to close an open menu.
  7. *
  8. * @usage
  9. *
  10. * A simple `menuClose` button can be added using the following markup:
  11. *
  12. * ```html
  13. * <button ion-button menuClose>Close Menu</button>
  14. * ```
  15. *
  16. * To close a certain menu by its id or side, give the `menuClose`
  17. * directive a value.
  18. *
  19. * ```html
  20. * <button ion-button menuClose="left">Close Left Menu</button>
  21. * ```
  22. *
  23. * @demo /docs/demos/src/menu/
  24. * @see {@link /docs/components#menus Menu Component Docs}
  25. * @see {@link ../../menu/Menu Menu API Docs}
  26. */
  27. export class MenuClose {
  28. constructor(_menu) {
  29. this._menu = _menu;
  30. }
  31. /**
  32. * @hidden
  33. */
  34. close() {
  35. const menu = this._menu.get(this.menuClose);
  36. menu && menu.close();
  37. }
  38. }
  39. MenuClose.decorators = [
  40. { type: Directive, args: [{
  41. selector: '[menuClose]'
  42. },] },
  43. ];
  44. /** @nocollapse */
  45. MenuClose.ctorParameters = () => [
  46. { type: MenuController, },
  47. ];
  48. MenuClose.propDecorators = {
  49. 'menuClose': [{ type: Input },],
  50. 'close': [{ type: HostListener, args: ['click',] },],
  51. };
  52. //# sourceMappingURL=menu-close.js.map