@NgModule static forRoot when implementing dynamic modules

I have this code in @NgModule: @NgModule({ declarations: [ AppComponent, DashboardComponent ], imports: [ BrowserModule, BrowserAnimationsModule, ClarityModule, RouterModule.forRoot([ { path: ”, redirectTo: ‘dashboard’, pathMatch: ‘full’ }, { path: ‘dashboard’, component: DashboardComponent }, ], {useHash: true}), LibraryTestModule.forRoot(ServicetestService), HttpModule ], If you can see i am injecting the ServicetestService to the LibraryTestModule. But in my case i…

Discover more