mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-26 08:13:34 +08:00
render views working
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user