throw error for view controller push

Closes #138
This commit is contained in:
Adam Bradley
2015-09-18 11:44:18 -05:00
parent b95e9609cb
commit 4a58321beb
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,9 @@ export class Nav extends ViewController {
super.onInit();
if (this.root) {
if (typeof this.root !== 'function') {
throw 'The [root] property in <ion-nav> must be given a reference to a component class from within the constructor.';
}
this.push(this.root);
}

View File

@ -64,6 +64,9 @@ export class ViewController extends Ion {
if (!componentType || !this.app.isEnabled()) {
return Promise.reject();
}
if (typeof componentType !== 'function') {
throw 'Loading component must be a component class, not "' + componentType.toString() + '"';
}
let resolve;
let promise = new Promise(res => { resolve = res; });