How to change the label of a Button dinamically?

Hi,

I would like to change the label/text of a button dinamically, is it possible?

I’ve tried to get the object, but it seems that just change the innerText of the innerHTML is not possible.

<button #btnFilter (click)="toggleMenu()" secondary>
  NEARBY
  <ion-icon name="ios-arrow-forward"></ion-icon>
</button>

.ts

@ViewChild('btnFilter') btnFilter: ElementRef;

this.btnFilter.nativeElement // = undefined

Any tips?

Thank you.

Is there a reason you’re not just interpolating {{something}} from the component?

Oups, no reason. You’re totally right. Sorry!

Thank you for your help! :stuck_out_tongue: