Angular Emoji Score
An enjoyable package for your readers to explain their reactions with emojis.
Demo
Click here for a live demo.
Installation
You can use npm to install the package.
NPM
npm install --save ng-emoji-score
Use
Follow the steps below to add the ng-emoji-score package to your project.
1. Import NgEmojiScoreModule Import NgEmojiScoreModule in the module you want to use in your application.
;; /* Import the module */; ; @
2. Use within HTML
In your HTML: Use the <emoji-score>
tag where you want to use your project.
3. Structure of the array to display emojis
Make sure the structure of the array resembles the array shown below;
-- Also be sure to include the Emoji model. import {Emoji} from 'ng-emoji-score/lib/emoji.model';
emojis: Emoji = ;
4. Structure of the index to display scores
Make sure the structure of the array resembles the array shown below;
-- Also make sure to include the Score model. import {Score} from 'ng-emoji-score/lib/score.model';
scores: Score = ;
5. Method that will work when emoji is selected In your Typescript file;
selectEmoji(event) {
console.log(event);
}
Features
Name | Type | Required | Default | Description |
---|---|---|---|---|
customEmojiItems | Emoji | No | - | For creating your own emojis. |
scores | Score | Yes | - | Scores previously given to the article. |
selectableEmojiCount | number | No | 3 | The maximum number of selectable emoji. |
selectableLimitMessage | string | No | You can select up to {{selectableEmojiCount}} emoji. | If you want to select more emoji than "selectableEmojiCount", this message will be displayed. |
customClass | string | No | - | It allows you to give your own style class. |
Events
Name | Parameters | Description |
---|---|---|
emojiSelect | $event | To specify the method that will run when the emoji is selected. |