Example, In my case, I want to change mat-icon expand_less to expand_more
HTML
<button mat-icon-button color="primary">
<mat-icon id="mat-{{name_dynamic_id}}" matTooltip="" aria-label="">
expand_less
</mat-icon>
</button>
TS, Use native javascript.
Get Id.
var dynamicMatIccon = document.getElementById("mat-" + value);
Change value:
dynamicMatIccon.innerHTML = "expand_more";
That it is.
No comments:
Post a Comment