Open astik opened 9 years ago
Hi Romain, I have the code to handle hydra collections in another library. You are right, It makes sense to have here in angular-jsonld. I will put it up and let you know.
Hi @astik , I still have to write the documentation, but if you want to try it the code is up. This is how you would use it:
entitiesHandler.getList('hydra:member');
You need to pass the member property (according to your local context). If you don't pass one it defaults to @graph
.
You can check the unit test in:
I hope it works for you. Let me know how it goes.
Best, alex
by the way... you should be able to flow links to the pages. For instance:
var promiseToNextPage = entitiesHandler.getList('hydra:member').then(function(res){
return res['hydra:nextPage'].get();
});
I have a factory :
While using the findAll function, I get this error :
This is completely normal as the JSON is like :
It is clear I need to work with "hydra:member". But I'd really like a simple way to manipulate the list.
@dunglas has a sweet approach to that : https://github.com/dunglas/DunglasJsonLdApiBundle#angularjs-integration
What I like is that we can manipulate directly the list (this is what is recommended by mgonto in its demo slide), but, in addition to that, we keep the pagination meta data.
I would be great to have this add-on directly into angular-jsonld in idea to have less code to bootstrap (I know, I'm lazy =P)