mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
only allow one component key
This commit is contained in:
@ -136,6 +136,9 @@ export class IonicApp {
|
|||||||
* @param {TODO} component The component to register
|
* @param {TODO} component The component to register
|
||||||
*/
|
*/
|
||||||
register(key, component) {
|
register(key, component) {
|
||||||
|
if (this.components[key]) {
|
||||||
|
throw Error('Registered component key ' + key + ' already exists.');
|
||||||
|
}
|
||||||
this.components[key] = component;
|
this.components[key] = component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<ion-menu #menu [content]="content" id="menu">
|
<ion-menu #menu [content]="content">
|
||||||
|
|
||||||
<ion-toolbar secondary>
|
<ion-toolbar secondary>
|
||||||
<ion-title>Left Menu</ion-title>
|
<ion-title>Left Menu</ion-title>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
{{p.title}}
|
{{p.title}}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button ion-item menu-toggle="menu" id="e2eCloseMenu">
|
<button ion-item menu-toggle id="e2eCloseMenu">
|
||||||
Close Menu
|
Close Menu
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user