mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
refactor(cssClass): use host class instead of renderer
Since angular2 alpha46 we can now use host: {‘class’:’item’} without it getting removed by user css classes.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import {Component, Directive, Optional, NgControl, ElementRef, Renderer} from 'angular2/angular2';
|
||||
import {Component, Directive, Optional, NgControl, ElementRef} from 'angular2/angular2';
|
||||
|
||||
import {Ion} from '../ion';
|
||||
import {Form} from '../../util/form';
|
||||
@ -30,7 +30,8 @@ import {Form} from '../../util/form';
|
||||
'[attr.aria-checked]': 'checked',
|
||||
'[attr.aria-disabled]': 'disabled',
|
||||
'[attr.aria-labelledby]': 'labelId',
|
||||
'(click)': 'click($event)'
|
||||
'(click)': 'click($event)',
|
||||
'class': 'item'
|
||||
},
|
||||
template:
|
||||
'<div class="item-inner">' +
|
||||
@ -47,10 +48,8 @@ export class Checkbox {
|
||||
constructor(
|
||||
form: Form,
|
||||
@Optional() ngControl: NgControl,
|
||||
elementRef: ElementRef,
|
||||
renderer: Renderer
|
||||
elementRef: ElementRef
|
||||
) {
|
||||
renderer.setElementClass(elementRef, 'item', true);
|
||||
this.form = form;
|
||||
form.register(this);
|
||||
|
||||
|
Reference in New Issue
Block a user