import { BrowserModule } from '@angular/platform-browser' ; import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { AppComponent } from './app.component' ; import { Page1Component } from './page1/page1.component' ; import { Page2Component } from './page2/page2.component' ; import { GoogleTagManagerModule } from 'angular-google-tag-manager' ; const routes = [ { path : 'page1' , component : Page1Component , } , { path : 'page2' , component : Page2Component , } , ] ; @ NgModule ( { declarations : [ AppComponent , Page1Component , Page2Component ] , imports : [ BrowserModule , RouterModule . forRoot ( routes , { relativeLinkResolution : 'legacy' } ) , GoogleTagManagerModule . forRoot ( { id : 'GTM-PV8586C' , } ) ] , providers : [ { provide : 'googleTagManagerCSPNonce' , useValue : 'CSP-NONCE' } , ] , bootstrap : [ AppComponent ] } ) export class AppModule { }