diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts index 7468400c1e..463c96d448 100644 --- a/src/components/icon/icon.ts +++ b/src/components/icon/icon.ts @@ -1,5 +1,6 @@ import { Directive, ElementRef, HostBinding, Input, Renderer } from '@angular/core'; +import { isTrueProperty } from '../../util/util'; import { Config } from '../../config/config'; import { Ion } from '../ion'; @@ -45,7 +46,7 @@ export class Icon extends Ion { /** @private */ _iconMode: string; /** @private */ - _isActive: any; + _isActive: boolean = true; /** @private */ _name: string = ''; /** @private */ @@ -145,11 +146,11 @@ export class Icon extends Ion { */ @Input() get isActive(): boolean { - return (this._isActive === undefined || this._isActive === true || this._isActive === 'true'); + return this._isActive; } set isActive(val: boolean) { - this._isActive = val; + this._isActive = isTrueProperty(val); this.update(); } @@ -178,7 +179,7 @@ export class Icon extends Ion { let iconMode = name.split('-', 2)[0]; if ( iconMode === 'ios' && - !this.isActive && + !this._isActive && name.indexOf('logo-') < 0 && name.indexOf('-outline') < 0) { name += '-outline';