Created
November 18, 2017 11:48
-
-
Save molcik/c28ca9dc62217a0a40b797fb5f545883 to your computer and use it in GitHub Desktop.
Angular Google Analytics App Module Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { environment } from '../environments/environment'; | |
import { AppComponent } from './app.component'; | |
import {GoogleAnalyticsService} from "./services/google-analytics.service"; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
] | |
providers: [ | |
GoogleAnalyticsService | |
], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { | |
constructor(protected _googleAnalyticsService: GoogleAnalyticsService) { } <-- We inject the service here to keep it alive whole time | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment