Cognity Angular
Table of contents
About
Angular module that is built to support Cognity functions.
Getting started
Installation
First install through npm:
npm install cognity-angular
Download the "dist" folder from https://github.com/socketio/socket.io-client
Load socket.io.js on your angular.json.
/* angular.json */
{
assets: [ ... ],
scripts: [
...
"src/scripts/socket.io-client/socket.io.js"
]
}
Declare global variable in polyfills.ts.
/* polyfills.ts */
(window as any).global = window;
Finally import the CognityAngular module into your apps module:
import { NgModule } from '@angular/core';
import { CognityAngularModule } from 'cognity-angular';
@NgModule({
imports: [
...
CognityAngularModule.forRoot({
API_KEY: [your API key]
})
],
})
export class MyModule {}