On my Angular website I'm injecting various third party scripts to collect analytics. These scripts are lazily loaded and will add event listeners (for f.e. click events) to certain elements on the page.
Normally I'd wrap this kind of functionality in a runOutsideAngular
, but since these scripts are external I don't think I have this power. Note that these scripts have nothing to do with Angular at all.
When running a performance recording or JavaScript profiler (both in Chrome) it seems the analytics functionality is somehow running through zone.js
, while I actually want them to be running as natively as possible.
How can I make sure these scripts are not influenced by, or influencing any Angular zones?