angular-weibo-emotify
0.3.0 • Public • Published angular-weibo-emotify
Angular directive and service to emotify weibo text.
Install
bower install angular-weibo-emotify
npm install angular-weibo-emotify
Usage
Inject module and set Emotions (Download) URL
angular.module('YourApp', ['weibo-emotify'])
.config(['weiboEmotifyProvider', function (weiboEmotifyProvider){
weiboEmotifyProvider.setEmotionsURL('https://example.com/emotions_v2.min.json')
}])
Use as Directive
<div weibo-emotify>{{ weibo_text }}</div>
Inject as Service
angular.module('someModule').controller('SomeCtrl', function ($scope, weiboEmotify, $sce) {
var text = "GitHub 年会 2015 [照相机][围观],图里的是 CEO。";
weiboEmotify.then(function (emotify){
$scope.text = $sce.trustAsHtml(emotify(text));
})
});
License
MIT
Package Sidebar
Install
npm i angular-weibo-emotify
Weekly Downloads