mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(Registry)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||
|
||||
import {IonicView} from 'ionic/ionic';
|
||||
import {IonicView, Register, Registry} from 'ionic/ionic';
|
||||
|
||||
import {ButtonPage} from './pages/button'
|
||||
import {NavPage} from './pages/nav'
|
||||
@@ -22,7 +22,8 @@ import {ModalPage} from './pages/modal'
|
||||
selector: 'ion-app',
|
||||
})
|
||||
@IonicView({
|
||||
templateUrl: 'main.html'
|
||||
templateUrl: 'main.html',
|
||||
directives: [Register]
|
||||
})
|
||||
class IonicApp {
|
||||
constructor() {
|
||||
@@ -49,7 +50,8 @@ class IonicApp {
|
||||
openPage(aside, component) {
|
||||
aside.close();
|
||||
|
||||
window.nav.setItems([component.component]);
|
||||
let nav = Registry.get('myNav');
|
||||
nav.setItems([component.component]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</ion-content>
|
||||
</ion-aside>
|
||||
|
||||
<ion-nav #content [root]="rootView"></ion-nav>
|
||||
<ion-nav #content [root]="rootView" [register]="content" register-id="myNav"></ion-nav>
|
||||
|
||||
<style>
|
||||
my-modal {
|
||||
|
||||
@@ -43,7 +43,6 @@ import {Routable, NavbarTemplate, Navbar, NavController, Content} from 'ionic/io
|
||||
export class ButtonPage {
|
||||
constructor(nav: NavController) {
|
||||
this.nav = nav;
|
||||
window.nav = nav;
|
||||
}
|
||||
|
||||
onButtonClick(event) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import {FormBuilder, Validators, formDirectives, ControlGroup} from 'angular2/fo
|
||||
import {Segment, SegmentButton, SearchBar, List, Item, ActionMenu, Modal, ModalRef,
|
||||
NavbarTemplate, Navbar, NavController, Content} from 'ionic/ionic';
|
||||
|
||||
console.log(NavbarTemplate, Navbar, Content, formDirectives);
|
||||
|
||||
@Component({
|
||||
selector: 'ion-view',
|
||||
|
||||
Reference in New Issue
Block a user