Summary of changes:
Load Intercom JS directly, without relying on window.onload event.
Inject Intercom JS using Render2 on boot, then do the bootstrap in the onLoad event of the injected script.
Also, added snapdragon as a devDependency because otherwise the npm run build would fail.
Intended/example use case:
Sometimes, when you refreshed or loaded/reloaded the page, the ng-intercom was not loaded due to window.onload being already triggered and intercom js not being injected. This should fix it.
Checklist:
[x] npm run build runs without error
[x] ng serve spawns app, Intercom messenger is visible and interactive, and there are no errors in the console
Summary of changes: Load Intercom JS directly, without relying on window.onload event. Inject Intercom JS using Render2 on boot, then do the bootstrap in the onLoad event of the injected script. Also, added
snapdragon
as a devDependency because otherwise thenpm run build
would fail.Intended/example use case: Sometimes, when you refreshed or loaded/reloaded the page, the ng-intercom was not loaded due to window.onload being already triggered and intercom js not being injected. This should fix it.
Checklist:
npm run build
runs without errorng serve
spawns app, Intercom messenger is visible and interactive, and there are no errors in the consoleCloses issue: #58