Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created October 25, 2022 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/0523b3114c7d6fb67361b9eba661642c to your computer and use it in GitHub Desktop.
Save NetanelBasal/0523b3114c7d6fb67361b9eba661642c to your computer and use it in GitHub Desktop.
import {
provideHttpClient,
withInterceptors
} from '@angular/common/http';
import { bootstrapApplication } from '@angular/platform-browser';
bootstrapApplication(AppComponent, {
providers: [
provideHttpClient(
withInterceptors([
(req, next) => {
// We can use the inject() function inside this function
// For example: inject(AuthService)
return next(req);
},
])
),
],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment