@bizappframework/ng-application-insightsdeprecated

Contains Microsoft Azure Application Insights module for Angular projects.

Usage no npm install needed!

<script type="module">
  import bizappframeworkNgApplicationInsights from 'https://cdn.skypack.dev/@bizappframework/ng-application-insights';
</script>

README

ng-application-insights

npm version Gitter

Contains Microsoft Azure Application Insights module for Angular projects.

Installation

npm install @bizappframework/ng-application-insights

Setup

import { BrowserAppInsightsModule } from '@bizappframework/ng-application-insights';

@NgModule({
    imports: [
        // Other module imports

        BrowserAppInsightsModule.forRoot({
            instrumentationKey: environment.aiInstrumentationKey,
            verboseLogging: true,
            enableDebug: true
        })
    ]
})
export class AppModule { }

Usage

import { Component, OnInit } from '@angular/core';

import { AppInsightsService } from '@bizappframework/ng-application-insights';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {
    private readonly _logger: Logger;

    constructor(private readonly _appInsightsService: AppInsightsService) { }

    ngOnInit(): void {
        this._appInsightsService.trackEvent('ngOnInit');
    }
}

Example

ng-logging-aspnetcore-sample

License

MIT License