Files
2015-09-29 11:45:44 -05:00

35 lines
527 B
TypeScript

import {Directive, ElementRef} from 'angular2/angular2';
import {Ion} from '../ion';
import {IonicApp} from '../app/app';
/**
* TODO
*/
@Directive({
selector: '[menu-close]',
properties: [
'menuClose'
],
host: {
'(click)': 'close()'
}
})
export class MenuClose extends Ion {
constructor(
app: IonicApp,
elementRef: ElementRef
) {
super(elementRef, null);
this.app = app;
}
close() {
let menu = this.app.getComponent(this.menuClose || 'menu');
menu && menu.close();
}
}