oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

RemoteData requests bypass HttpInterceptor #370

Closed Aeseir closed 6 years ago

Aeseir commented 6 years ago

Hi,

Great little app. I noticed that when using remote data, the requests that are made bypass custom built httpinterceptors. Is there any way to force it to use the custom built interceptors?

Axinet commented 6 years ago

You had to use beta version (branch v2.0.0), which can be installed with npm i --save ng2-completer@beta command. Stable version uses Http service, which doesn't use interceptors, only in beta version author switched to HttpClient (which uses interceptors). Don't know why this version is still not officially released as it is also only one compatible with Angular 5 (which was released some time ago). Older versions could be marked in readme as compatible with older Angular versions.

Aeseir commented 6 years ago

Already using beta version, still bypasses interceptors. Only workaround is to force request headers into it which is annoying.

Axinet commented 6 years ago

I use interceptors to authorize with the token and after switching to beta version everything works as expected. Before switch requests were denied. I use custom build interceptors, so it is rather not the problem with this library.

Aeseir commented 6 years ago

Not sure what to tell ya, I'm still having this issue even after reinstalling the package. All my other calls get their headers appended with auth token except this one. Guess i'll wait till v2 release.

oferh commented 6 years ago

@Aeseir maybe using a custom data provider can solve the issue see here

manojgudi2016 commented 6 years ago

@Aeseir , try deleting the "ng2-completer" folder from node_modules i.e "node_modules\ng2-completer", and try re-installing the package, this should work. It worked in my case.

samuelexyz commented 6 years ago

Any news i'm trying with @next version from scratch but i have the same issue

Aeseir commented 6 years ago

I added some wrappers to it on beginnig but eventually moved on from the plugin as i didn't need it.