Git Product home page Git Product logo

ng-intercom's Introduction

ng-intercom

npm npm Build status Maintenance

This is an Intercom wrapper for Angular 2+ with dependency injection for universal applications.

It supports all documented intercom methods.

BETA VERSION

master is now hosting the 1.0.0 beta version of ng-intercom. If you need to make changes to the latest stable version, please PR against 0.x.x. If you need to use the last 0.x version, please run npm install --save --save-exact [email protected].

If you find issues with this version, please file an issue as soon as possible so we can take a look at it. We appreciate your cooperation!

ALPHA VERSION

If you want to try the latest features, check out the 1.0.0-alpha branch! Features include automatic script loading and intercom directives! If you find an issue, please report it!

Installation

This package is on NPM, so just run

$ npm install ng-intercom@latest --save

Configuration

  1. Import IntercomModule to app.module.ts. The module will automatically include the APP_ID instantiation, so you DO NOT need to copy the install script from Intercom and place it in your index.html.
import { IntercomModule } from 'ng-intercom';

@NgModule({
  imports: [
    ...
    IntercomModule.forRoot({
      appId: <your_app_id>, // from your Intercom config
      updateOnRouterChange: true // will automatically run `update` on router event changes. Default: `false`
    })
    ...
  ]
})
export class AppModule { }
  1. Use in your components/directives/whatever you want!
// App
import { Component, OnInit } from '@angular/core';
import { Intercom } from 'ng-intercom';

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

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

Development

To run live testing: ng test

To run tests: npm test

To run distribution: npm run build:dist

To publish npm run build:dist && npm publish dist

Credits

Maintained by Scott Wyatt and Wilson Hobbs in 2017 with contributions from Florian Reifschneider, Devon Sams, and Humberto Rocha

ng-intercom's People

Contributors

devonsams avatar flore2003 avatar humrochagf avatar koslun avatar scott-wyatt avatar wbhob avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.