title: NullInjectorError: StaticInjectorError(AppModule)[AppComponent -> GoogleTagManagerService]: Angular 8
body: <p>i have also imported HttpClientModule and also properly configure GoogleTagManagerService.</p>
  <pre class="lang-js prettyprint-override"><code>import { HttpClientModule, /* other http imports */ } from &quot;@angular/common/http&quot;;
  
  @NgModule({
    imports: [
     HttpClientModule,
    ]}),
    providers: [
      { provide: 'googleTagManagerId', useValue: 'GTM-XXXXXXX' }
    ],
  });
  </code></pre>
  <p>But i am still getting errors .
  i am using Google Tag Manager package and import every things properly .
  and now i clone the project in new system, so now i am getting this error</p>
  <p><strong>app.component.ts code</strong></p>
  <pre class="lang-js prettyprint-override"><code>import { GoogleTagManagerService } from 'angular-google-tag-manager';
  
  constructor(
    private gtmService: GoogleTagManagerService
  ) {}
  
  ngOnInit(): void {
    this.router.events.subscribe((evt) =&gt; {
      if (evt instanceof NavigationEnd) {
        const gtmTag = {
          event: 'page',
          pageName: evt.url
        };
        this.gtmService.pushTag(gtmTag);
      }
      if (!(evt instanceof NavigationEnd)) {
        return;
      }
    });
  }
  </code></pre>