0.1.5 • Published 8 years ago

ngSinaEmoji v0.1.5

Weekly downloads
31
License
-
Repository
github
Last release
8 years ago

ngSinaEmoji

整合新浪远程表情组件 ####Useage

$ npm install ngSinaEmoji
var Demo = angular.module('Demo',['ngSinaEmoji'])
// 必须要绑定model
 <textarea ng-model="emoji" ng-sina-emoji target="#emotion" app-key="1362404091" cols="50" rows="5"></textarea>
<button id="emotion">表情</button>

Params

keyvalue
target事件触发元素,必填
appKey新浪授权ID(可不填,有默认ID)

Service

        .controller('EmojiCtrl',function ($scope,SinaEmoji) {
            $scope.destroy = function(){
                // 销毁实例
                SinaEmoji.destroy();
                // 解析表情
                SinaEmoji.parseEmotions(value)
            }
        })
        //常常使用过滤器来解析
        .filter('parseEmotions',function (SinaEmoji,$sce) {
            return function (value) {
                return $sce.trustAsHtml(SinaEmoji.parseEmotions(value));
            }
        })
// html
<p ng-bind-html="emoji | parseEmotions"></p>
0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago