troyanskiy / ngx-resource-core

RESTful Core Library
40 stars 10 forks source link

Restarting services #36

Closed cschaepe closed 5 years ago

cschaepe commented 5 years ago

I have an angular 6 application which is successfully using your library. My problem comes in when I reload the application with a F5 or browser refresh. It seems when the app is re-initialized the service using ngx-resource is not in a correct state. Is there something i need to do to re-init or cleanup on an F5?

Firstly I get an null ref error in your code ResourceHandlerHttpClient.js line 83 --> var keys = response.headers.keys(); Adding code to check for null ie "if (response.headers && response.headers.keys)" makes it happy.

The next problem happens when I make my first restful call after a refresh. A call that normally works fine fails. In looking at the internal state of the service requestHandler.http.handler.chain is null and is not when it works.

Now I understand the problem may be in my app and in no way can you debug my issue. Really what I wanted to know is if there is any cleanup or restart code that I need to do upon an app restart via a browser refresh

beradrian commented 5 years ago

I'm also using this library in Angular 6 application (and used it since Angular 2). There's no way to restart or cleanup this library nor I ever need it. Most probably the issue is somewhere in your code.

troyanskiy commented 5 years ago

Hello @all I did some refactoring and repository restructuring. From now on new repository is located here https://github.com/troyanskiy/ngx-resource Please create new issues in new repo. I will close all the issues in that repo.

Also I have released 7.0.0-beta.5 version with Observables support. Please test it and create new issues in new repo if you will find some bugs.

To update to new version run npm i --save @ngx-resource/core@beta @ngx-resource/handler-ngx-http@beta

Breaking changes:

ResourceGlobalConfig

IResourceParams and IResourceAction

Deprecation

New

I still have to update Docs and provide migration guide.

Thank you @all !!!