0

We setup applicationinsights as explain official doc. We setup applicationInsights in app.component.ts constructor.

We want to user Angulartics2 to managed google analitycs and applicationinsights.

However, Angulartics2 needs appInsights to be global. By declaring appInsights inside of the constructor of app.component.ts, appInsights is not global.

if we setup window['appInsights'] = new ApplicationInsights(....), everything works as expected. What is the correct way to use application insight with angulartics2. Doc page is not very useful.

Serafín
  • 132
  • 1
  • 9
  • It's unfortunate that they designed their API that way. – Aluan Haddad Jul 30 '19 at 17:48
  • We finally not use Angulartics2. We use a custom services. I think is not ready for the new appInsigth library 2.1.1. Even appInsigth has a bit of confusion about which current version is correct if 1.0.20 or 2.1.1. – Serafín Aug 01 '19 at 08:09

0 Answers0