wKoza / ngx-upload

Ngx-upload is an upload module for Angular Ivy ready
30 stars 15 forks source link

Remove HttpClientModule to avoid LazyLoaded module conflicts #83

Closed zainniazi closed 4 years ago

zainniazi commented 4 years ago

HttpClientModule added in ngx-upload.module.ts resets the HTTP_INTERCEPTORS from app module if added in child/lazyloaded modules.

zainniazi commented 4 years ago

@wKoza Hi, Could you please look at this ? We have HttpClientModule imported in NgxUploadModule, which if imported in shared.module or any child module it resets the HTTP_INTERCEPTORS.

wKoza commented 4 years ago

Hi @zainniazi, indeed, the library was not designed like that because it is very light. Using it in a lazy loaded module can lead to unwanted side effects at the configuration level. I will make some tests and if it's ok, I will release a V10 with this PR.

wKoza commented 4 years ago

Hi @zainniazi , I've created a new branch of the ngx-uploader-app application here . There is a shared module with NgxUploadModule. Are you in this configuration ? You are entirely free to change this code in order to show up your problematic.

zainniazi commented 4 years ago

Hi @wKoza, sure let me create an example of the issue and i'll also share a stackoverflow reference to have a better look into this problem.

zainniazi commented 4 years ago

@wKoza Please have a look here; it defines the problem we are having. https://stackoverflow.com/a/57007882/3477592

wKoza commented 4 years ago

@zainniazi , I remember this problem but it seemed to me that it had been solved on the Angular side. If you test this branch, u can see there is no problem with the interceptors. What is your Angular version ? Can you write a repro with stackblitz / Github ?

wKoza commented 4 years ago

@zainniazi , HttpClientModule has been removed in the v10.0.0.

zainniazi commented 4 years ago

Thanks @wKoza, Sorry i have been busy; i didn't send you a sample. Looking forward to collaborate again.