mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
@ -44,6 +44,9 @@ export class Nav extends ViewController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
if (this.root) {
|
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);
|
this.push(this.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ export class ViewController extends Ion {
|
|||||||
if (!componentType || !this.app.isEnabled()) {
|
if (!componentType || !this.app.isEnabled()) {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
if (typeof componentType !== 'function') {
|
||||||
|
throw 'Loading component must be a component class, not "' + componentType.toString() + '"';
|
||||||
|
}
|
||||||
|
|
||||||
let resolve;
|
let resolve;
|
||||||
let promise = new Promise(res => { resolve = res; });
|
let promise = new Promise(res => { resolve = res; });
|
||||||
|
Reference in New Issue
Block a user