woot, toolbar/content same context!

This commit is contained in:
Adam Bradley
2015-05-13 20:53:16 -05:00
parent fb24589209
commit acd10c3232
3 changed files with 12 additions and 3 deletions

View File

@ -42,7 +42,13 @@ export class NavItem {
this.domElement.classList.add('nav-item');
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++) {
this.createHeader(this.headers[i], context, injector);

View File

@ -1,12 +1,14 @@
<div *ion-header>
<h1 class="toolbar-title">First Page</h1>
<h1 class="toolbar-title">First Page: Instance {{ val }}</h1>
</div>
<ion-content class="padding" style="background:blue">
<ion-content class="padding" style="background:lightblue">
<p>First Page: Instance {{ val }}</p>
<p>
<button (click)="push()">Push (Go to 2nd)</button>

View File

@ -15,6 +15,7 @@ export class FirstPage {
nav: NavController
) {
this.nav = nav;
this.val = Math.round(Math.random() * 8999) + 1000;
}
push() {