mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00

Menu has been improved to make it easier to open, close, toggle and enable menus. Instead of injecting `IonicApp` to find the menu component, you now inject `MenuController`. Was: ``` constructor(app: IonicApp) { this.app = app; } openMenu() { this.app.getComponent('leftMenu').close(); } ``` Now: To programmatically interact with any menu, you can inject the `MenuController` provider into any component or directive. This makes it easy get ahold of and control the correct menu instance. By default Ionic will find the app's menu without requiring a menu ID. An id attribute on an `<ion-menu>` is only required if there are multiple menus on the same side. If there are multiple menus, but on different sides, you can use the name of the side to get the correct menu If there's only one menu: ``` constructor(menu: MenuController) { this.menu = menu; } openMenu() { this.menu.close(); } ``` If there is a menu on the left and right side: ``` toggleMenu() { this.menu.toggle('left'); } ``` If there are multiple menus on the same side: ``` <ion-menu id="myMenuId" side="left">...</ion-menu> <ion-menu id="otherMenuId" side="left">...</ion-menu> closeMenu() { this.menu.close('myMenuId'); } ```
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
export * from './components/app/app'
|
|
export * from './components/app/id'
|
|
export * from './components/action-sheet/action-sheet'
|
|
export * from './components/alert/alert'
|
|
export * from './components/blur/blur'
|
|
export * from './components/button/button'
|
|
export * from './components/checkbox/checkbox'
|
|
export * from './components/content/content'
|
|
export * from './components/icon/icon'
|
|
export * from './components/input/input'
|
|
export * from './components/item/item'
|
|
export * from './components/item/item-sliding'
|
|
export * from './components/menu/menu-controller'
|
|
export * from './components/menu/menu'
|
|
export * from './components/menu/menu-types'
|
|
export * from './components/menu/menu-toggle'
|
|
export * from './components/menu/menu-close'
|
|
export * from './components/label/label'
|
|
export * from './components/list/list'
|
|
export * from './components/show-hide-when/show-hide-when'
|
|
export * from './components/modal/modal'
|
|
export * from './components/nav/nav'
|
|
export * from './components/nav/nav-controller'
|
|
export * from './components/nav/view-controller'
|
|
export * from './components/nav/nav-params'
|
|
export * from './components/nav/nav-push'
|
|
export * from './components/nav/nav-router'
|
|
export * from './components/navbar/navbar'
|
|
export * from './components/option/option'
|
|
export * from './components/overlay/overlay'
|
|
export * from './components/slides/slides'
|
|
export * from './components/radio/radio-button'
|
|
export * from './components/radio/radio-group'
|
|
export * from './components/scroll/scroll'
|
|
export * from './components/scroll/pull-to-refresh'
|
|
export * from './components/searchbar/searchbar'
|
|
export * from './components/segment/segment'
|
|
export * from './components/select/select'
|
|
export * from './components/tabs/tabs'
|
|
export * from './components/tabs/tab'
|
|
export * from './components/tap-click/tap-click'
|
|
export * from './components/toggle/toggle'
|
|
export * from './components/toolbar/toolbar'
|