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:
Adam Bradley
2015-11-14 15:13:35 -06:00
parent 4bbee6e89f
commit 9ef27f8c56
8 changed files with 38 additions and 51 deletions

View File

@ -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);