diff --git a/src/components/button/button.ts b/src/components/button/button.ts index e4dc18445d9..c4f23503c7f 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -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'; diff --git a/src/components/item/test/sliding/index.ts b/src/components/item/test/sliding/index.ts index d9571ea7dbe..96d055747d2 100644 --- a/src/components/item/test/sliding/index.ts +++ b/src/components/item/test/sliding/index.ts @@ -11,12 +11,25 @@ class E2EPage { items = []; shouldShow: boolean = true; + moreText: string = "Dynamic More"; + archiveText: string = "Dynamic Archive"; + constructor(private app: App, private nav: NavController) { - for (let x = 0; x < 20; x++) { + for (let x = 0; x < 5; x++) { this.items.push(x); } } + changeDynamic() { + if (this.moreText.includes("Dynamic")) { + this.moreText = "Changed More"; + this.archiveText = "Changed Archive"; + } else { + this.moreText = "Dynamic More"; + this.archiveText = "Dynamic Archive"; + } + } + closeOpened() { this.list.closeSlidingItems(); } diff --git a/src/components/item/test/sliding/main.html b/src/components/item/test/sliding/main.html index 15495fc7c3a..0f366a0dc65 100644 --- a/src/components/item/test/sliding/main.html +++ b/src/components/item/test/sliding/main.html @@ -83,7 +83,38 @@

Ben Sperry

+ + + + + One Line, dynamic option + + + + + + + + + + One Line, dynamic icon-left option + + + + @@ -111,9 +142,10 @@

ng-for {{data}}

-

- -

+
+ + +