ng2-intercom
Version:
NG2 Intercom integration. See https://github.com/CaliStyle/angular2-intercom
33 lines (26 loc) • 841 B
text/typescript
import { Directive, ElementRef, Input, HostListener } from '@angular/core';
import { Intercom } from './intercom';
export class IntercomTrackEventDirective {
intercomService: Intercom;
eventName: string;
constructor(intercomService: Intercom) {
this.intercomService = intercomService;
}
onClick(e) {
this.intercomService.trackEvent(this.eventName);
}
}
export class IntercomNewMessageDirective {
intercomService: Intercom;
msg: string;
constructor(intercomService: Intercom) {
this.intercomService = intercomService;
}
onClick(event) {
this.intercomService.showNewMessage(this.msg);
}
}