Issue
I created a app clone Instagram to learn Angular, NodeJS. I wanna add a button contains icon in comment but i don't know how to do it. If anyone has idea or suggest a library, tool, anything, please leave a comment. Thank you!
Solution
I found a solution myself.
<div (keyup.enter)="postComment()" class="container_comment">
<button (click)="isEmojiPickerVisible = !isEmojiPickerVisible;"><img src="assets/icons/smile-success-32.png"
width="28" height="28" alt=""></button>
<input type="text" placeholder="Add a comment..."
[(ngModel)]="comment"/>
<emoji-mart class="emoji-mart" *ngIf="isEmojiPickerVisible" (emojiSelect)="addEmoji($event)"
title="Choose your emoji"></emoji-mart>
</div>
and typeScript file add this
public isEmojiPickerVisible: boolean;
public comment: string = '';
public addEmoji(event: { emoji: { native: any; }; }) {
this.comment = `${this.comment}${event.emoji.native}`;
this.isEmojiPickerVisible = false;
}
Answered By - Toof_LD

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.