Hi,
I found probably stupid problem but how can I change icon in ionic 2 after click.
This is a like button with translations.
I would like to achieve different icon and text based on click state.
This is my html:
<button ion-button icon-left small round block
color="primary" (click)="onLike()">
<ion-icon name="heart"></ion-icon>
{{ "LIKE" | translate }}
</button>
and this is my controller for that:
onLike () {
if (User.getCurrentUser()) {
Place.like(this.place);
this.showToast('Liked');
} else {
this.openLoginModal();
}
}
I need to change icon based like default one: name="heart"
liked: name=“heart-outline”
Plus how is best way to manage translation in that case with text: Like, Liked
Can someone explain me that or give some advice?
Thank you