fix(aside): auto register w/o id

This commit is contained in:
Max Lynch
2015-09-09 10:07:16 -05:00
parent e46863640e
commit 69101e2ec0
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
<ion-aside #aside [content]="content" id="mainMenu"> <ion-aside #aside [content]="content">
<ion-toolbar><ion-title>Plugins</ion-title></ion-toolbar> <ion-toolbar><ion-title>Plugins</ion-title></ion-toolbar>
<ion-content> <ion-content>
<ion-list> <ion-list>

View File

@ -18,7 +18,8 @@ import {dom} from 'ionic/util'
selector: 'ion-aside', selector: 'ion-aside',
properties: [ properties: [
'content', 'content',
'dragThreshold' 'dragThreshold',
'id'
], ],
defaultProperties: { defaultProperties: {
'side': 'left', 'side': 'left',
@ -89,6 +90,11 @@ export class Aside extends Ion {
super.onInit(); super.onInit();
this.contentElement = (this.content instanceof Node) ? this.content : this.content.getNativeElement(); this.contentElement = (this.content instanceof Node) ? this.content : this.content.getNativeElement();
if(!this.id) {
// Auto register
this.app.register('menu', this);
}
if(this.contentElement) { if(this.contentElement) {
this.contentElement.addEventListener('transitionend', ev => { this.contentElement.addEventListener('transitionend', ev => {
//this.setChanging(false) //this.setChanging(false)