I want to change the text of a button when it‘s cklicked and change it back when it‘s clicked again. How can I do that?
I tried something like that. But I dont know who I can adress to the text because there is no property like eg with color for ion-buttons
Html
<button (click)="changeText()" ion-button>Hello</button>
TS
public text: string = 'hello';
constructor
public changeText(): void {
if(this.text === 'hello') {
this.text = 'rank'
} else {
this.text = 'hello'
}
}