Comments (8)
Hi @ahatius,
sorry for my late reply but I hadn't the time to look into it. This nice little project runs and I analyzed your domain model and one issue is that you have cyclic dependencies as shown in this diagram:
Therefore the problem is that you call the SpringDataRestAdapter
recursively and then it will never stop because of this cyclic dependencies.
I will check to add a flag to disable this check that the link was already fetched as this is an issue but then you must not have cyclic dependencies.
I would propose that you remove these dependencies and then update the project and I can check again for the flag such that you get the proper responses.
Would that be ok for you?
Thanks and regards,
Guy
from angular-spring-data-rest.
Hi @ahatius,
can you please provide me an example of what you are doing with the filter and without the filter it works properly right? You can also use the caching of the $http
service described here such that you do not call the back end multiple times with the same request: https://docs.angularjs.org/api/ng/service/$http#caching
Thanks and regards,
Guy
from angular-spring-data-rest.
Hi Guy
Thanks for the fast reply :)
Actually my wording was not quite correct when I said filter. I'm not using an angular filter, I was actually referencing the comment on line 261 in angular-spring-data-rest-provider.js. According to that every resource will be fetched only once.
However, I tried to copy my JSON responses and noticed that they are way too big to copy in here, so I created a small, simple project which provides an example of my problem. Maybe I'm doing something wrong and that's the reason for my issue.
You can find the example project here. The project just needs to be checked out and started, everything else should be automatically initialized so you just need to navigate to http://localhost:8080/index
. I have also added a screenshot of how it looks, what it's supposed to look like and what the final JSON object looks like.
I'd be really glad if you could have a look at it if you have a moment.
from angular-spring-data-rest.
Hi Guy
Thank you very much for that analysis.
I think that should be feasible. I have removed the circular dependencies for the Product, ProductRate and ProductCategory entities in the test project. I have also removed them for the Job and JobDetail entities, although those didn't seem to be problematic.
Cheers,
Ahatius
from angular-spring-data-rest.
Hey Ahatius,
nice I am glad to hear that. I will try to integrate the new flag as soon as I have more time and then I will do a new release.
Thanks and regards,
Guy
from angular-spring-data-rest.
I have the same problem here. I have a directive which loads a tree recursivly from my server (using the recursive=true
option for SpringDataRestAdapter.process
and given links to follow) . If I add the directive twice on a single page, one tree is fully populated, the other one has only its root nodes.
I can see that the request for the "root nodes" is made twice, but the following requests which dive deeper are done only once and the resolved response is in one case only filled with the root nodes, the other one has all childs that were fetched.
It is very complicated to build up a standalone testcase, but maybe you can have a look at the screenshot. It is a console.log
from the two responses. The first is with empty 'childDiagnosisGroups', the second includes them as object. You can see that the link is for both the same, the initial requests are identical. If I make another call to it, it results everytime the full tree. I think this two requests get grouped at some point and the links are followed only once (good for performance), but the resulting data isn't distributed to every call.
Hope that helps to explain the problem and make further investigation possible
from angular-spring-data-rest.
Hi
the flag fetchMultiple
flag has been added. Read more here in the documentation: https://github.com/guylabs/angular-spring-data-rest#how-to-automatically-fetch-links (nead the end of the section)
I will now release 0.4.5
and then you can update and adapt your projects.
Regards,
Guy
from angular-spring-data-rest.
Thank you very much, will try it out ;)
from angular-spring-data-rest.
Related Issues (20)
- Given data is not of type object. HOT 6
- Fetch recursive causes infinite loop HOT 19
- Handling HTTP code 204 HOT 8
- Cache in $http HOT 2
- Would it be possible to provide the lib through a cdn? HOT 5
- Allow AngularJS dependency version 1.4 HOT 1
- Handling spring data rest exception HOT 2
- How to chain resources calls HOT 3
- Support Angular 1.5 HOT 6
- Correct use of resources children HOT 3
- Collection of Links HOT 2
- Fetching resources compatible with saving HOT 2
- Inheritance support HOT 5
- Draft a new release for 1.5 support HOT 2
- POST with Spring projections? HOT 2
- "Given data '' is not of type object." when empty array response. HOT 12
- Automatically retrieve links in an object property HOT 1
- Release of version 0.4.6? HOT 1
- Not able to fetch underlying link data HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-spring-data-rest.