render views working

This commit is contained in:
Adam Bradley
2015-07-31 22:35:32 -05:00
parent 984cdd07c3
commit c0223edabe
11 changed files with 94 additions and 68 deletions

View File

@ -1,6 +1,8 @@
import {Directive, View, Ancestor, Optional, ElementRef, forwardRef} from 'angular2/angular2';
import {ProtoViewRef} from 'angular2/src/core/compiler/view_ref';
import {TemplateRef} from 'angular2/angular2';
import {ToolbarBase} from '../toolbar/toolbar';
import {IonicConfig} from '../../config/config';
import {IonicComponent, IonicView} from '../../config/annotations';
@ -26,14 +28,14 @@ import {ViewItem} from '../view/view-item';
</button>
<div class="toolbar-title">
<div class="toolbar-inner-title">
<content select="ion-title"></content>
<ng-content select="ion-title"></ng-content>
</div>
</div>
<div class="toolbar-item toolbar-primary-item">
<content select="[primary]"></content>
<ng-content select="[primary]"></ng-content>
</div>
<div class="toolbar-item toolbar-secondary-item">
<content select="[secondary]"></content>
<ng-content select="[secondary]"></ng-content>
</div>
</div>
`,
@ -77,7 +79,7 @@ export class Navbar extends ToolbarBase {
didEnter() {
const titleEle = this._ttEle || (this._ttEle = this.getNativeElement().querySelector('ion-title'));
this.app.title(titleEle.textContent);
titleEle && this.app.title(titleEle.textContent);
}
}
@ -137,7 +139,10 @@ class NavbarItem {
selector: 'template[navbar]'
})
export class NavbarTemplate {
constructor(@Optional() item: ViewItem, protoViewRef: ProtoViewRef) {
item && item.addProtoViewRef('navbar', protoViewRef);
constructor(
@Optional() item: ViewItem,
@Optional() templateRef: TemplateRef
) {
item && item.addTemplateRef('navbar', templateRef);
}
}