( interceptorFns: HttpInterceptorFn[], )
| 153 | * @publicApi |
| 154 | */ |
| 155 | export 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 | |
| 170 | const LEGACY_INTERCEPTOR_FN = new InjectionToken<HttpInterceptorFn>( |
| 171 | typeof ngDevMode !== 'undefined' && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : '', |
no test coverage detected