mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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; });
|
||||
|
Reference in New Issue
Block a user