mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
28 lines
494 B
TypeScript
28 lines
494 B
TypeScript
import {onInit, Directive} from 'angular2/angular2';
|
|
|
|
import {IonicApp} from 'ionic/ionic'
|
|
|
|
|
|
@Directive({
|
|
selector: '[register]',
|
|
properties: [
|
|
'register',
|
|
'registerId: register-id'
|
|
],
|
|
host: {
|
|
'this.register-id': 'registerId'
|
|
},
|
|
lifecycle: [onInit]
|
|
})
|
|
export class Register {
|
|
constructor(app: IonicApp) {
|
|
this.app = app;
|
|
}
|
|
onInit() {
|
|
if(!this.register || !this.registerId) {
|
|
return;
|
|
}
|
|
this.app.register(this.registerId, this.register);
|
|
}
|
|
}
|