mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
decorator lyfe
This commit is contained in:
@ -2,9 +2,9 @@ import {ElementRef, Renderer, EventEmitter, onChange} from 'angular2/angular2';
|
|||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from 'angular2/src/facade/lang';
|
||||||
import {setProperty} from 'angular2/src/forms/directives/shared'
|
import {setProperty} from 'angular2/src/forms/directives/shared'
|
||||||
|
|
||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, Directive} from 'angular2/angular2';
|
||||||
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
import {Ancestor} from 'angular2/angular2';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/angular2';
|
||||||
import {onInit} from 'angular2/angular2';
|
import {onInit} from 'angular2/angular2';
|
||||||
|
|
||||||
//pretty sure this has changed in the latest angular
|
//pretty sure this has changed in the latest angular
|
||||||
@ -12,7 +12,6 @@ import {NgControl} from 'angular2/forms';
|
|||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/component';
|
||||||
import {Icon} from '../icon/icon';
|
import {Icon} from '../icon/icon';
|
||||||
|
|
||||||
|
|
||||||
@IonicComponent(Checkbox)
|
@IonicComponent(Checkbox)
|
||||||
@View({
|
@View({
|
||||||
template: `
|
template: `
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, ComponentAnnotation, Directive} from 'angular2/angular2';
|
||||||
import {DirectiveMetadata} from 'angular2/src/render/api';
|
import {DirectiveMetadata} from 'angular2/src/render/api';
|
||||||
|
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
@ -6,18 +6,20 @@ import {Platform} from 'ionic/platform/platform';
|
|||||||
|
|
||||||
const platformMode = Platform.getMode();
|
const platformMode = Platform.getMode();
|
||||||
|
|
||||||
|
|
||||||
export class IonicDirective extends Directive {
|
export class IonicDirective extends Directive {
|
||||||
constructor(ComponentType) {
|
constructor(ComponentType) {
|
||||||
super( appendModeConfig(ComponentType) );
|
super( appendModeConfig(ComponentType) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IonicComponent extends Component {
|
export let IonicComponent = (function(){
|
||||||
constructor(ComponentType) {
|
function IonicComponentFactory(ComponentClass) {
|
||||||
super( appendModeConfig(ComponentType) );
|
return new Component(appendModeConfig(ComponentClass));
|
||||||
}
|
}
|
||||||
}
|
IonicComponentFactory.prototype = Object.create(ComponentAnnotation.prototype);
|
||||||
|
return IonicComponentFactory;
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
function appendModeConfig(ComponentType) {
|
function appendModeConfig(ComponentType) {
|
||||||
let config = ComponentType.config;
|
let config = ComponentType.config;
|
||||||
|
Reference in New Issue
Block a user