https://github.com/zedwang/ngsinaemoji
Sina emoji components of Angular
https://github.com/zedwang/ngsinaemoji
Last synced: 12 months ago
JSON representation
Sina emoji components of Angular
- Host: GitHub
- URL: https://github.com/zedwang/ngsinaemoji
- Owner: zedwang
- License: gpl-3.0
- Created: 2016-08-09T05:15:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T08:36:10.000Z (about 6 years ago)
- Last Synced: 2025-07-03T01:03:59.337Z (12 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### ngSinaEmoji
整合新浪远程表情组件
####Useage
#####Npm
```js
$ npm install ngSinaEmoji
```
#####Bower
```js
$ bower install ngSinaEmoji
```
```js
var Demo = angular.module('Demo',['ngSinaEmoji'])
```
```html
// 必须要绑定model
表情
```
#### Params
| key | value |
| :--: | :--------------------: |
| target | 事件触发元素,必填 |
| appKey | 新浪授权ID(可不填,有默认ID) |
#### Events
onEmojiShow在激活表情之前触发
onEmojiLoaded在激活表情之后触发
```js
// example
$rootScope.$on('onEmojiShow',function(){
// do Sth
});
```
#### Service
```js
.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
// html
```