From cbf990f4cf8645815d1eb366732810fb0c6dab23 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 16 Sep 2015 12:32:17 -0500 Subject: [PATCH] error when same id registered Closes #123 --- ionic/components/app/app.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ionic/components/app/app.ts b/ionic/components/app/app.ts index a846da8631..be3847c64d 100644 --- a/ionic/components/app/app.ts +++ b/ionic/components/app/app.ts @@ -136,6 +136,9 @@ export class IonicApp { * @param {TODO} component The component to register */ register(id, component) { + if (this.components[id] && this.components[id] !== component) { + console.error('Component id "' + id + '" already registered.'); + } this.components[id] = component; } @@ -165,8 +168,8 @@ export class IonicApp { * @param {TODO} key TODO * @return {TODO} TODO */ - getComponent(key) { - return this.components[key]; + getComponent(id) { + return this.components[id]; } /**