cognity-angular
TypeScript icon, indicating that this package has built-in type declarations

0.0.218 • Public • Published

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

Load socket.io.js on your angular.json.

/* angular.json */
{
	assets: [ ... ],
	scripts: [
		...
		"./node_modules/cognity-angular/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, COGNITY_CONFIG } from "cognity-angular";

@NgModule({
	imports: [
		...,
		CognityAngularModule
	],
	providers: [
		...,
		{
		provide: COGNITY_CONFIG,
		useValue: {
			API_KEY: [COGNITY_API_KEY],
			BASE_URL: [COGNITY_BASE_URL],
			NOTIFICATION_URL: [COGNITY_NOTIFICATION_URL],
			SOCKET_URL: [COGNITY_SOCKET_URL],
		},
		},
	],
})
export class MyModule {}

Readme

Keywords

none

Package Sidebar

Install

npm i cognity-angular

Weekly Downloads

194

Version

0.0.218

License

none

Unpacked Size

2.29 MB

Total Files

79

Last publish

Collaborators

  • rockycabaero
  • rcogal