mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
woot, toolbar/content same context!
This commit is contained in:
@ -42,7 +42,13 @@ export class NavItem {
|
|||||||
this.domElement.classList.add('nav-item');
|
this.domElement.classList.add('nav-item');
|
||||||
this.domElement.setAttribute('data-nav-item-id', this.id);
|
this.domElement.setAttribute('data-nav-item-id', this.id);
|
||||||
|
|
||||||
let context = this.nav.contentElementRef
|
// TODO: talk to misko about correct way to set context
|
||||||
|
let context = {
|
||||||
|
boundElementIndex: 0,
|
||||||
|
parentView: {
|
||||||
|
_view: componentRef.location.parentView._view.componentChildViews[0]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
for (let i = 0; i < this.headers.length; i++) {
|
for (let i = 0; i < this.headers.length; i++) {
|
||||||
this.createHeader(this.headers[i], context, injector);
|
this.createHeader(this.headers[i], context, injector);
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
<div *ion-header>
|
<div *ion-header>
|
||||||
|
|
||||||
<h1 class="toolbar-title">First Page</h1>
|
<h1 class="toolbar-title">First Page: Instance {{ val }}</h1>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<ion-content class="padding" style="background:blue">
|
<ion-content class="padding" style="background:lightblue">
|
||||||
|
|
||||||
|
<p>First Page: Instance {{ val }}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button (click)="push()">Push (Go to 2nd)</button>
|
<button (click)="push()">Push (Go to 2nd)</button>
|
||||||
|
@ -15,6 +15,7 @@ export class FirstPage {
|
|||||||
nav: NavController
|
nav: NavController
|
||||||
) {
|
) {
|
||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
|
this.val = Math.round(Math.random() * 8999) + 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
push() {
|
push() {
|
||||||
|
Reference in New Issue
Block a user