We are trying to embed Salesforce Chat into our Angular based application. To do this, we got the embedded code snippets (Chat Code Snippet and Meta Tag Code Snippet) from Salesforce Setup, under Embedded Service Deployments
URI: /lightning/setup/EmbeddedServiceDeployments/home
We are trying to load the script dynamically in root component of our Angular application. But the chat button is rendered four times. We tried by adding this embedded script into constructor / ngOnInit. But still the chat button is rendered multiple time even though the constructor or ngOnInit block is executed only once.
As shown in below screenshot of Developer Tools, the embedded script is repeated four times instead of once.
Please advise how to fix this