I'm using Angular 4 and Zopim. In the index.html the Zopim is loaded - works great. If I load the page I can in the Chrome console write
$zopim.livechat.getName()
and then get the name of the current user. However, I would like to set the name in the Typescript file.
My problem here is that I don't understand how I can execute the jQuery in Typescript without installing any npm jQuery stuff. I've read other posts like: Can TypeScript interact with jQuery without a definition file? which suggests to use
declare var $;
I've tried this but get the error that $zopim is not defined.
Is it possible, and if yes - how can I set the name in Zopim from Typescript? Zopim API documentation:
$zopim(function() {
$zopim.livechat.setName('Logged in name');
$zopim.livechat.setEmail('user@somewhere.com');
});
Thanks!