mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Custom page in nav test
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<ion-nav>
|
||||
<ion-view>
|
||||
</ion-view>
|
||||
<my-page>
|
||||
<button class="button button-stable">Push</button>
|
||||
<button class="button button-stable">Pop</button>
|
||||
</my-page>
|
||||
</ion-nav>
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
import {bootstrap} from 'angular2/core';
|
||||
import {Component, Template} from 'angular2/angular2';
|
||||
import {Component, Template, NgElement, Parent} from 'angular2/angular2';
|
||||
import {NavView} from 'ionic2/components/nav-view/nav-view';
|
||||
import {View} from 'ionic2/components/view/view';
|
||||
import {Log} from 'ionic2/util';
|
||||
|
||||
@Component({
|
||||
selector: 'my-page',
|
||||
})
|
||||
@Template({
|
||||
inline: "<div><h2>I'm a page!</h2><content></content></div>"
|
||||
})
|
||||
export class MyPage extends View {
|
||||
constructor(@NgElement() ele:NgElement, @Parent() nav: NavView) {
|
||||
Log.log('Page constructed!', ele, nav)
|
||||
super(ele, nav)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({ selector: '[ion-app]' })
|
||||
@Template({
|
||||
directives: [NavView, View],
|
||||
directives: [NavView, View, MyPage],
|
||||
url: 'main.html'
|
||||
})
|
||||
class IonicApp {
|
||||
|
||||
Reference in New Issue
Block a user