Closed Tokenizers closed 3 years ago
Hello, it seems that you didn't declare the interceptor in your module. So it can't retrieve the reference to LocalStorageService since is doesn't belong to any module's Injection container.
You have to add to your module's provider section something like that.
...
providers: [
{provide: HTTP_INTERCEPTORS, useClass: AppInterceptorService , multi: true}
...
},
...
Hello,
I encountered a small problem, and i don't know what i'm doing wrong, could you help me please ?
Versions
Describe the bug When i want to use the LocalStorageService, then the service has the strategy attribute to undefined.
To Reproduce Steps to reproduce the behavior:
"ngx-webstorage": "6.0.0"
and do a retrieve
TypeError: Cannot read property 'get' of undefined at LocalStorageService.retrieve (ngx-webstorage.js:74) at AppInterceptorService.buildHeaders (app-interceptor.service.ts:61) at AppInterceptorService.intercept (app-interceptor.service.ts:29) at HttpInterceptorHandler.handle (http.js:1258) at HttpXsrfInterceptor.intercept (http.js:1886) at HttpInterceptorHandler.handle (http.js:1258) at HttpInterceptingHandler.handle (http.js:1936) at MergeMapSubscriber.project (http.js:1082) at MergeMapSubscriber._tryNext (mergeMap.js:44) at MergeMapSubscriber._next (mergeMap.js:34)
Additional context i migrated from angular 7 to 10 i moved ngx-webstore from v2 to newer version (v6) i also tried to upgrade to angular 11 and use ngx-webstore v7.1 but the bug still occurs.
Thanks in advance