0.1.0 • Published 7 years ago

ng2-intercom v0.1.0

Weekly downloads
8
License
ISC
Repository
github
Last release
7 years ago

Angular2 Intercom

This is an Intercom wrapper for Angular2 that also works with angular-universal It supports all intercom methods.

This was taken from: https://github.com/CaliStyle/angular2-intercom and turned into an NPM module by Chris Moyer.

All credit for the original development goes to Scott Wyatt (https://github.com/scott-wyatt).

Pre-requisites

Be sure to add a script tag including Intercom in your main HTML

Configuration

Import the IntercomModule in your AppModule

// Bootstrap

import { IntercomModule, INTERCOM_DIRECTIVES } from 'ng2-intercom';

@NgModule({
	imports: [
		IntercomModule,
		NgbModule.forRoot(),
	],
	declarations: [
		...INTERCOM_DIRECTIVES,
	],
export class AppModule { }

Inject the Intercom service into your AppComponent to initialize it

// App
...
import { Intercom } from 'ng2-intercom/intercom';

@Component({
	selector: 'app',
	template: `...`
})
export class AppComponent implements OnInit {
	constructor(private intercom: Intercom){ }

	ngOnInit() {
		this.intercom.init({
			app_id: <app_id>,
			// Supports all optional configuration.
			widget: {
				"activator": "#intercom"
			}
		});
	}
}

Use it in HTML as an attribute directive:

<a [intercomTrackEvent]="'Click Link'">Link that's tracked</a>
<a [intercomNewMessage]="'Pre-populated message'">Request Help</a>
0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago