fix(button): check for icon and add css after content checked

fixes #6662
This commit is contained in:
Brandy Carney
2016-06-07 13:10:36 -04:00
parent ba3e786f2b
commit f7b2ea277d
3 changed files with 60 additions and 4 deletions

View File

@ -210,6 +210,14 @@ export class Button {
this._assignCss(true);
}
/**
* @private
*/
ngAfterContentChecked() {
this._readIcon(this._elementRef.nativeElement);
this._assignCss(true);
}
/**
* @private
*/
@ -256,6 +264,9 @@ export class Button {
}
}
// Remove any classes that are set already
this._setClass(this._icon, false);
if (nodes.length > 1) {
if (nodes[0] === ICON && nodes[1] === TEXT) {
this._icon = 'icon-left';