I have a button on my screen where if the user has already added clicked on it, it is a mat-filled-button but if I haven't clicked on it, it is a mat-button
My code looks like this
<button
*ngIf="myVote !== 'UPVOTE'"
mat-button
color="primary"
(click)="onVote('UPVOTE')"
>
UPVOTE
</button>
<button
*ngIf="myVote === 'UPVOTE'"
mat-flat-button
color="primary"
(click)="onVote('NONE')"
>
UPVOTE
</button>
Basically I have two buttons and only one shows. Obviously, this is very ugly.
Is there a way where I can achieve the same outcome with only one button and it conditionally is a mat-flat-button
or a mat-button
based on a set of logic?