diff --git a/ionic/components/nav/nav.ts b/ionic/components/nav/nav.ts index 9c16a21ac8..729eba6fe3 100644 --- a/ionic/components/nav/nav.ts +++ b/ionic/components/nav/nav.ts @@ -44,6 +44,9 @@ export class Nav extends ViewController { super.onInit(); if (this.root) { + if (typeof this.root !== 'function') { + throw 'The [root] property in must be given a reference to a component class from within the constructor.'; + } this.push(this.root); } diff --git a/ionic/components/view/view-controller.ts b/ionic/components/view/view-controller.ts index e33c19af67..1c10f197a6 100644 --- a/ionic/components/view/view-controller.ts +++ b/ionic/components/view/view-controller.ts @@ -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; });