Issue
I have this <i>
tag
<i class="actionicon icon-star" [ngClass]="{'yellow' : data.isLiked}" (click)="Like(data)"
aria-hidden="true" title="Liked"></i>
I have this data.isLiked
is true then yellow class is added but i want to change the title also
if isLiked true then title should be Unlike
otherwise Like
Solution
You can do it by binding your title attribute to angular, like this:[title]=" data.isLiked ? 'Liked' : 'Unliked' "
Example:
<i class="actionicon icon-star" [ngClass]="{'yellow' : data.isLiked}" (click)="Like(data)"
aria-hidden="true" [title]=" data.isLiked ? 'Liked' : 'Unliked' "></i>
Answered By - Ricardo Machado
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.