Custom page in nav test

This commit is contained in:
Max Lynch
2015-03-29 11:07:48 -06:00
parent 1c15080ab0
commit b2fa14729a
2 changed files with 21 additions and 4 deletions

View File

@@ -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>

View File

@@ -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 {