Skip to content

Instantly share code, notes, and snippets.

@wizlee
Created June 13, 2021 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wizlee/9fb5bc670cace9971bbc13b369e7fffd to your computer and use it in GitHub Desktop.
Save wizlee/9fb5bc670cace9971bbc13b369e7fffd to your computer and use it in GitHub Desktop.
angular-marketplace-totorial-main.ts
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { CometChat } from "@cometchat-pro/chat";
import { COMETCHAT_CONSTANTS } from "./CONSTS";
if (environment.production) {
enableProdMode();
}
const appSetting = new CometChat.AppSettingsBuilder()
.subscribePresenceForAllUsers()
.setRegion(COMETCHAT_CONSTANTS.REGION)
.build();
CometChat.init(COMETCHAT_CONSTANTS.APP_ID, appSetting).then(
() => {
console.log("CometChat initialized successfully");
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.error(err));
},
(error) => {
console.log("CometChat initialization failed with error:", error);
// Check the reason for error and take appropriate action.
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment