UNPKG

textnotdownload

Version:

An angular 2 module to support built-in and custom emoji

23 lines (17 loc) 584 B
import {Injectable} from '@angular/core'; import {Subject} from 'rxjs/Subject'; import {Observable} from 'rxjs/Observable'; @Injectable() export class EmotionService { private emotionInformation: any; private subject: Subject<string> = new Subject<string>(); constructor() { } SetEmotionInformation(emotionInformation: any): void { this.emotionInformation = ':' + emotionInformation.emojiId + ':'; this.subject.next(this.emotionInformation); } CaptureEmojiClick(): Observable<any> { return this.subject.asObservable(); } }