Updating the AppModule

As always, we won't be able to use the AuthService unless we add the required reference to the AppModule class. Open the app.module.shared.ts file and update it by adding the following highlighted lines:

[...]import { RouterModule } from '@angular/router';import { AuthService } from './services/auth.service';import { AppComponent } from './components/app/app.component';[...]imports: [    CommonModule,    HttpClientModule,    FormsModule,    ReactiveFormsModule,    RouterModule.forRoot([        { path: '', redirectTo: 'home', pathMatch: 'full' },        { path: 'home', component: HomeComponent },        { path: 'quiz/create', component: QuizEditComponent },        { path: 'quiz/edit/:id', component: QuizEditComponent }, { path: 'quiz/:id', component: QuizComponent ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.