ng-intercom
This is an Intercom wrapper for Angular 2+ with dependency injection for universal applications.
It supports all intercom methods.
Installation
This package is on NPM, so just run
$ npm install ng-intercom --save
Configuration
import { IntercomModule } from 'ng-intercom';
import { AppComponent } from './app';
@NgModule({
imports: [
IntercomModule.forRoot()
]
})
export class AppModule{}
...
import { Intercom } from 'ng-intercom';
@Component({
selector: 'app',
template: `...`
})
export class AppComponent implements OnInit {
constructor(
private intercom: Intercom
){}
ngOnInit() {
this.intercom.init({
app_id: <app_id>,
widget: {
"activator": "#intercom"
}
});
}
}
Development
To compile, just run npm run build
. It will compile into the dist directory.
Distribution
When publishing to NPM, make sure to npm run build
first, and ignore src. Then type cd dist
and npm publish
.