ng-sina-emotion
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

NgSinaEmotion

NgSinaEmotion是基于sina-emotion 新浪表情包封装的一个用于angular2+的组件。 演示地址

安装说明

  
   npm i ng-sina-emotion
   引入模块 import { NgSinaEmotionModule } from 'ng-sina-emotion';
   在app.module.ts里引入 SinaEmotionService
   providers: [ SinaEmotionService ]
  

使用方法


< button nz-button nzType="primary" nz-dropdown nzTrigger="click" [nzDropdownMenu]="menu" (click)="openShowEmotion()">表情包< /button>
  
  < nz-dropdown-menu #menu="nzDropdownMenu">
    < sina-emotion #sinaEmotion [(showEmotion)]="showEmotion" [(emotionData)]="emotionData" (clickEmotionChange)="onAddString()">< /sina-emotion>
  < /nz-dropdown-menu>

获取表情包服务方法

  
 constructor(
    private sinaEmotion: SinaEmotionService,
  ) { }

  /**
   * 获取新浪表情包 json 数据 
   * */ 
  getSinaEmotion() {
    this.sinaEmotions.getServers('jQuery2021', '1362404091', 'cnname').subscribe(res => {
      this.emotionData = res._body.data;
    })
  } 
   

api

名称 默认值 说明
clickEmotionChange @Output 点击icon 的回调方法
emotionData SinaEmotionDatas[] = [] 原始数据
showEmotion false 显示表情框

Readme

Keywords

none

Package Sidebar

Install

npm i ng-sina-emotion

Weekly Downloads

0

Version

1.0.5

License

none

Unpacked Size

108 kB

Total Files

20

Last publish

Collaborators

  • miduchina