AngularJS Emoji Picker is a simple AngularJs module which allows you to add emoji images to your model value. This project is heavily inspired by Angular Emoji, but it doesn't require external dependencies like JQuery, JQuery plugins and so forth.
The simplest way to install Emoji Picker is use Bower.
bower install angular-emoji-picker --save
This will install the latest release.
You can also just download the contents of the dist/
folder and add dependencies manually.
angular.module('myModule', ['vkEmojiPicker']);
By default Emoji Picker uses its own popover, which, to be honest, has not a very great realization. But you have an option - you can use external dependencies: Angular Strap and Bootstrap. In that case you have to include additional scripts on your page:
<link rel="stylesheet" href="/path/to/bootstrap/dist/css/bootstrap.min.css">
<script src="/path/to/angular-strap/dist/angular-strap.min.js"></script>
<script src="/path/to/angular-strap/dist/angular-strap.tpl.min.js"></script>
angular.module('myModule', ['vkEmojiPicker', 'mgcrea.ngStrap']);
Also Emoji Picker provides a couple handy directives:
emojify
- converts an emoji string into image
<div ng-bind-html="message | emojify"></div>
hexify
- converts an emoji string into UTF-8 characters
<div ng-bind-html="message | hexify"></div>
- The picker requires AngularJS 1.3. Didn't test on 1.4 versions, probably it's broken.
- Angular-UI-Bootstrap is not supported yet
If you found a bug or have an idea feel free to open a new issue.
Any contribution is highly appreciated especially to fix all my grammar mistakes :)
- Fork it ( https://github.com/terranisu/angular-emoji-picker/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Create a feature and add tests if required
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Also consider running any code through the code style checker jscs
(or even better use it in your editor) with preset set to yandex
,
but the parameter validateIndentation
should be changed to a value 2
instead of original one 4
The files in the dist/
folder, plus dependencies, are all you need to use Emoji Picker. But if
you'd like to build it yourself, you have to use grunt.
First off, you need to have nodejs installed. Then install all dependencies of the project with npm and bower, then install grunt and run the default task.
$ npm install
$ sudo npm install -g grunt-cli
$ bower install
$ grunt
The task compiles all source files.
You can also run grunt watch:dev
to have it rebuild on change.
Unit tests are run with karma and written using mocha, chai and sinon
To run the tests:
- Install all dependencies via npm
- Install dependencies with bower.
- Install the karma cli
- Run the tests using karma or npm
$ npm install
$ bower install
$ sudo npm install -g karma-cli
$ karma start karma.conf.js OR npm test