mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +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'); } ```
Ionic 2: Alpha
Ionic 2 is the next generation of Ionic, the open-source mobile app development SDK that makes it easy to build top quality mobile apps with web technologies.
Ionic 2 is based on the new 2.x version of AngularJS, and comes with many significant performance, usability, and feature improvements.
See Adam Bradley's Building apps with Ionic 2 slides for a quick overview of Ionic 2.
Try Ionic 2
To try Ionic 2 today, visit the Ionic 2 Docs. We would love any feedback you have or to know when you encounter issues, by filing an issue report on this repo.
Contributing to Ionic 2
See CONTRIBUTING.md
Ionic 2 Examples
There are a few real Ionic 2 apps in the wild. The most complete is the Ionic Conference App, a perfect starting point for building your own conference app.
Description
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
angularcapacitorframeworkfrontendioniciosjavascriptmaterial-designmobilepwareactstencilstenciljstypescriptvuewebwebcomponents
Readme
MIT
2.4 GiB
Languages
TypeScript
60.8%
HTML
24.8%
SCSS
10.9%
JavaScript
2%
Vue
1%
Other
0.5%