[英]Why whole rxjs is imported on a feature angular module
答:我找到了問題的根源,我在那個模塊上導入 customHttpProvider,我猜ng-jhipster
包拉了整個rxjs
庫
import { Injector } from '@angular/core';
import { Http, RequestOptions, XHRBackend } from '@angular/http';
import { JhiInterceptableHttp } from 'ng-jhipster';
import { AuthExpiredInterceptor } from './auth-expired.interceptor';
import { ErrorHandlerInterceptor } from './errorhandler.interceptor';
import { NotificationInterceptor } from './notification.interceptor';
export function interceptableFactory(
backend: XHRBackend,
defaultOptions: RequestOptions,
injector: Injector
//stateStorageService: StateStorageService,
//eventManager: EventManager
) {
return new JhiInterceptableHttp(
backend,
defaultOptions,
[
new AuthExpiredInterceptor(injector
//, stateStorageService
),
// Other interceptors can be added here
new ErrorHandlerInterceptor(
//eventManager
),
new NotificationInterceptor()
]
);
};
export function customHttpProvider() {
return {
provide: Http,
useFactory: interceptableFactory,
deps: [
XHRBackend,
RequestOptions,
Injector,
//StateStorageService,
//EventManager
]
};
};
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.