mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
App annotation/mode attribute
This commit is contained in:
@ -4,6 +4,9 @@ import {setProperty} from 'angular2/src/forms/directives/shared'
|
||||
|
||||
//pretty sure this has changed in the latest angular
|
||||
import {NgControl} from 'angular2/forms';
|
||||
|
||||
import {Ion} from '../ion';
|
||||
import {IonicConfig} from '../../config/config';
|
||||
import {IonicComponent} from '../../config/annotations';
|
||||
import {Icon} from '../icon/icon';
|
||||
|
||||
@ -53,12 +56,15 @@ import {Icon} from '../icon/icon';
|
||||
</div>`,
|
||||
directives: [Icon]
|
||||
})
|
||||
export class Checkbox {
|
||||
export class Checkbox extends Ion {
|
||||
constructor(
|
||||
ngControl: NgControl,
|
||||
renderer: Renderer,
|
||||
elementRef: ElementRef
|
||||
elementRef: ElementRef,
|
||||
ionicConfig: IonicConfig
|
||||
) {
|
||||
super(elementRef, ionicConfig);
|
||||
|
||||
this.ngControl = ngControl;
|
||||
this.renderer = renderer;
|
||||
this.elementRef = elementRef;
|
||||
@ -67,10 +73,6 @@ export class Checkbox {
|
||||
//this.change = new EventEmitter("change");
|
||||
}
|
||||
|
||||
onInit() {
|
||||
Checkbox.applyConfig(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Much like ngModel, this is called from our valueAccessor for the attached
|
||||
* ControlDirective to update the value internally.
|
||||
|
@ -5,7 +5,7 @@
|
||||
$checkbox-ios-color: #007aff;
|
||||
|
||||
|
||||
.checkbox-ios {
|
||||
.checkbox[mode="ios"] {
|
||||
|
||||
.media-checkbox {
|
||||
min-width: 20px;
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
NgFormModel,
|
||||
FormBuilder
|
||||
} from 'angular2/forms';
|
||||
import {Checkbox, Content, List} from 'ionic/ionic';
|
||||
import {App, Checkbox, Content, List} from 'ionic/ionic';
|
||||
//import {IONIC_DIRECTIVES} from 'ionic/ionic'
|
||||
|
||||
// @Component({
|
||||
@ -45,8 +45,7 @@ import {Checkbox, Content, List} from 'ionic/ionic';
|
||||
// }
|
||||
// }
|
||||
|
||||
@Component({ selector: 'ion-app' })
|
||||
@View({
|
||||
@App({
|
||||
templateUrl: 'main.html',
|
||||
directives: [Checkbox, List, Content, NgControlName, NgFormModel]
|
||||
})
|
||||
@ -89,8 +88,3 @@ class IonicApp {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function main(ionicBootstrap) {
|
||||
ionicBootstrap(IonicApp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user