MCPcopy Create free account
hub / github.com/angular/angular / withInterceptors

Function withInterceptors

packages/common/http/src/provider.ts:155–168  ·  view source on GitHub ↗
(
  interceptorFns: HttpInterceptorFn[],
)

Source from the content-addressed store, hash-verified

153 * @publicApi
154 */
155export function withInterceptors(
156 interceptorFns: HttpInterceptorFn[],
157): HttpFeature<HttpFeatureKind.Interceptors> {
158 return makeHttpFeature(
159 HttpFeatureKind.Interceptors,
160 interceptorFns.map((interceptorFn) => {
161 return {
162 provide: HTTP_INTERCEPTOR_FNS,
163 useValue: interceptorFn,
164 multi: true,
165 };
166 }),
167 );
168}
169
170const LEGACY_INTERCEPTOR_FN = new InjectionToken<HttpInterceptorFn>(
171 typeof ngDevMode !== 'undefined' && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : '',

Callers 3

provider_spec.tsFile · 0.90
resource_spec.tsFile · 0.90

Calls 2

makeHttpFeatureFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected