Customer live chat widget in ionic app


I am basically trying to use a customer live-chat feature in my Ionic tab application wherein I am using super tabs. I am using PureChat for the customer live chat functionality.

So basically this is the structure of my app:


To include PureChat in my app, there’s a small javascript that I have to copy paste in my app.

Problem #1 : I am putting that script in my index.html which is making the PureChat hello Button appear throughout the app on all pages when I only want that button to appear on my contact Page.

How to make that script run only on contact Page or have that PureChat Hello button, render only on my contact page? I have struck a dead end here.

I have tried hiding the button in my index .html by finding that element and setting its style.display property to “none” but this doesn’t seem to work when I run the app in my android device. However, hiding element this way works when I ionic serve and run the app in the browser.

Any suggestions to fix this are highly welcome! Puhleez help!

Dont put that stuff in index.html or any javascript in html files (angular templates) for that matter

But use the javascript api to build logic

I have not used it but a quick read of the docs indicate that that is the only way

The idea is How to build that. I have gone through the javascript api but it does not seem to be working.