Created
February 6, 2022 11:20
-
-
Save Alvaro237/13b6cda6d5849772d57cc85ea6f5d31c to your computer and use it in GitHub Desktop.
Angular #CoreModule
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
| No es necesario exportar nada, sirve para mantener app.module.ts más limpio, solo cuando se necesite ya que la mejor forma es en cada servicio usar providedIn root por ejemplo |
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 { NgModule } from '@angular/core'; | |
| import { HTTP_INTERCEPTORS } from '@angular/common/http'; | |
| import { ShoppingListService } from './shopping-list/shopping-list.service'; | |
| import { RecipeService } from './recipes/recipe.service'; | |
| import { AuthInterceptorService } from './auth/auth-interceptor.service'; | |
| import { LoggingService } from './logging.service'; | |
| @NgModule({ | |
| providers: [ | |
| ShoppingListService, | |
| RecipeService, | |
| { | |
| provide: HTTP_INTERCEPTORS, | |
| useClass: AuthInterceptorService, | |
| multi: true | |
| } | |
| ] | |
| }) | |
| export class CoreModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment