use title service

This commit is contained in:
Adam Bradley
2015-10-04 11:45:32 -05:00
parent 2b86705f54
commit dfe19a962d
4 changed files with 23 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
import {Component, View, ElementRef, NgZone, DynamicComponentLoader} from 'angular2/angular2';
import {Title} from 'angular2/angular2';
import {ClickBlock} from '../../util/click-block';
import {ScrollTo} from '../../animations/scroll-to';
@@ -31,7 +31,7 @@ export class IonicApp {
* TODO
*/
constructor() {
this.overlays = [];
this._title = new Title();
this._disTime = 0;
this._trnsTime = 0;
@@ -43,9 +43,12 @@ export class IonicApp {
* Sets the document title.
* @param {string} val Value to set the document title to.
*/
title(val) {
// TODO: User angular service
document.title = val;
setTitle(val) {
this._title.setTitle(val);
}
getTitle() {
return this._title.getTitle(val);
}
/**

View File

@@ -1,7 +1,11 @@
import {App} from 'ionic/ionic';
import {App, IonicApp} from 'ionic/ionic';
@App({
templateUrl: 'main.html'
})
class E2EApp {}
class E2EApp {
constructor(app: IonicApp) {
app.setTitle('Basic Buttons');
}
}

View File

@@ -104,7 +104,7 @@ export class Navbar extends ToolbarBase {
}
didEnter() {
this.app.title(this.getTitleText());
this.app.setTitle(this.getTitleText());
}
}