mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
add ngOnDestroy to ion-icon and remove added css class
This commit is contained in:
@ -54,7 +54,7 @@ export class Icon {
|
|||||||
private _md: string = '';
|
private _md: string = '';
|
||||||
private _css: string = '';
|
private _css: string = '';
|
||||||
mode: string;
|
mode: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
config: Config,
|
config: Config,
|
||||||
private _elementRef: ElementRef,
|
private _elementRef: ElementRef,
|
||||||
@ -70,11 +70,20 @@ export class Icon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ngOnDestroy() {
|
||||||
|
if (this._css) {
|
||||||
|
this._renderer.setElementClass(this._elementRef, this._css, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
get name() {
|
get name() {
|
||||||
return this._name;
|
return this._name;
|
||||||
}
|
}
|
||||||
|
|
||||||
set name(val) {
|
set name(val) {
|
||||||
if (!(/^md-|^ios-|^logo-/.test(val))) {
|
if (!(/^md-|^ios-|^logo-/.test(val))) {
|
||||||
// this does not have one of the defaults
|
// this does not have one of the defaults
|
||||||
@ -85,7 +94,7 @@ export class Icon {
|
|||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
get ios(): string {
|
get ios(): string {
|
||||||
return this._ios;
|
return this._ios;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user