I am developing a custom Angular8 App in order to migrate a webchat widget deployment I was developed in Vainilla.js.
But I have an issue, I am trying to load the ININ library that usually get loaded using a .
I tried to ddownload it into the assets folder and them I tried to made an import of ININ library but it did not work:
import {ININ} from '../../../assets/external-purecloud/jsapi-v1.js';
And also I tried to load in the app-component and in the chat-angular-component as a script tag but it can not be interpretated from any of those components or any service.
How can we use it in my Angular8 project in order to create the webchat using this sintaxis?: ININ.webchat.create(this.chatConfig).then((webchat) => { ... }.
I appreciate your help and suggestions.
Thank you.
I put the script tag in the index.html and then in the app service I made a function in order to the ININ library be returned to the chat component that use this service:
getININ(): any{
// tslint:disable-next-line:no-string-literal
const ininLibrary: any=window['ININ'];
return ininLibrary;
}
And then I can get this lib accessed via the chat component.
Thank you.
Glad you got it working! The link below is how we did it in the dev tools (ember). The jsapi script is loaded dynamically and the chat is started in response to the load event. Note that there's both v1 and v2 chat stuff going on in that file.