ng-intercom
Advanced tools
Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "ng-intercom", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "An Intercom wrapper for Angular", | ||
"main": "intercom.ts", | ||
"main": "index", | ||
"repository": { | ||
@@ -15,2 +15,5 @@ "type": "git", | ||
"author": "scott-wyatt", | ||
"contributors": [ | ||
"Wilson Hobbs <wilsonhobbs1@gmail.com> (https://www.wilsonhobbs.com/)" | ||
], | ||
"license": "MIT", | ||
@@ -21,9 +24,12 @@ "bugs": { | ||
"homepage": "https://github.com/CaliStyle/angular2-intercom#readme", | ||
"dependencies": { | ||
"@angular/core": "^2.4.8" | ||
"peerDependencies": { | ||
"@angular/core": "*" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^2.1.6" | ||
"@angular/core": "^4.0.0-rc.2", | ||
"rxjs": "^5.2.0", | ||
"typescript": "^2.2.0", | ||
"zone.js": "^0.7.7" | ||
}, | ||
"typings": "./ng-intercom.d.ts" | ||
"typings": "./index.d.ts" | ||
} |
# ng-intercom | ||
This is an Intercom wrapper for Angular ^2 with dependency injection for universal applications. | ||
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`. | ||
## Configuration | ||
```ts | ||
// Bootstrap | ||
// Add the module | ||
import { BROWSER_INTERCOM_PROVIDERS } from './ng-intercom/ng-intercom'; | ||
import { IntercomModule } from 'ng-intercom'; | ||
import { AppComponent } from './app'; | ||
bootstrap(AppComponent, [ | ||
...BROWSER_INTERCOM_PROVIDERS | ||
]) | ||
.catch(err => console.error(err)); | ||
@NgModule({ | ||
imports: [ | ||
IntercomModule.forRoot() | ||
] | ||
}) | ||
export class AppModule{} | ||
@@ -26,3 +32,3 @@ ``` | ||
... | ||
import { Intercom } from './ng-intercom/ng-intercom'; | ||
import { Intercom } from 'ng-intercom'; | ||
@@ -29,0 +35,0 @@ @Component({ |
import { IntercomBrowser } from './intercom.browser' | ||
import { Intercom, IntercomEnvironment } from './intercom' | ||
import { provide } from '@angular/core' | ||
@@ -6,0 +5,0 @@ export const BROWSER_INTERCOM_PROVIDERS = [ |
@@ -1,15 +0,14 @@ | ||
export class IntercomBrowser { | ||
init (data) { | ||
(<any> window).Intercom("boot", data); | ||
init(data) { | ||
(<any>window).Intercom("boot", data); | ||
} | ||
boot (data) { | ||
(<any> window).Intercom("boot", data); | ||
boot(data) { | ||
(<any>window).Intercom("boot", data); | ||
} | ||
update (data) { | ||
(<any> window).Intercom("update", data); | ||
update(data) { | ||
(<any>window).Intercom("update", data); | ||
} | ||
shutdown () { | ||
(<any> window).Intercom("shutdown"); | ||
shutdown() { | ||
(<any>window).Intercom("shutdown"); | ||
} | ||
} |
export class IntercomNode { | ||
init (data) { | ||
init(data: object) { | ||
// throw new Error('Error init IntercomNode') | ||
} | ||
boot (data) { | ||
boot(data: object) { | ||
// throw new Error('Error boot IntercomNode') | ||
} | ||
update (data) { | ||
update(data: object) { | ||
// throw new Error('Error update IntercomNode') | ||
} | ||
shutdown () { | ||
shutdown() { | ||
// throw new Error('Error shutdown IntercomNode') | ||
} | ||
} |
@@ -21,16 +21,16 @@ import { Injectable } from '@angular/core'; | ||
export class Intercom { | ||
constructor(public intercom: IntercomEnvironment){} | ||
constructor(public intercom: IntercomEnvironment) { } | ||
init(data){ | ||
init(data: Object) { | ||
return this.intercom.init(data); | ||
} | ||
boot(data) { | ||
boot(data: Object) { | ||
return this.intercom.boot(data); | ||
} | ||
update (data) { | ||
update(data: Object) { | ||
return this.intercom.update(data); | ||
} | ||
shutdown () { | ||
shutdown() { | ||
return this.intercom.shutdown(); | ||
} | ||
} |
@@ -1,6 +0,4 @@ | ||
import { IntercomNode } from './intercom.node' | ||
import { Intercom, IntercomEnvironment} from './intercom' | ||
import { IntercomNode } from './intercom.node'; | ||
import { Intercom, IntercomEnvironment } from './intercom'; | ||
import { provide } from '@angular/core' | ||
export const NODE_INTERCOM_PROVIDERS = [ | ||
@@ -7,0 +5,0 @@ IntercomNode, |
@@ -16,4 +16,4 @@ { | ||
}, | ||
"files": [ | ||
"ng-intercom.ts" | ||
"include": [ | ||
"src/*.ts" | ||
], | ||
@@ -23,2 +23,2 @@ "exclude": [ | ||
] | ||
} | ||
} |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
4673
112
54
4
1
+ Added@angular/core@19.1.2(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedzone.js@0.15.0(transitive)
- Removed@angular/core@^2.4.8
- Removed@angular/core@2.4.10(transitive)
- Removedrxjs@5.5.12(transitive)
- Removedsymbol-observable@1.0.1(transitive)
- Removedzone.js@0.7.8(transitive)