Open robopeter opened 8 years ago
A complete example would be useful, I agree. I'll see if I can add one.
In the mean time, this should do the trick in your case: (not verified, may contain typos)
var context = new ResourceContext(HalResource);
var collection = context.get(URI);
collection.$get().then(function () {
var articles = collection.$linkRel('articles');
// Do something with articles
});
Ok, I think I got things working. I had several problems, several of which were really angular problems vs this library directly! The two calls to "get" above were non-obvious at first glance.
It would also probably be good to illustrate the differences between $propRel vs $linkRel vs $loadPaths complete with the corresponding JSON for when you'd use each. Thanks again!
@jcassee ,
I am reinforcing the @robopeter needs.
It is being complicated to understand all the options available.
For instance, when should i use $propRel, $linkRel, $loadPaths
Could a complete working example be provided to augment the snippets of examples provided? Specifically I'd really appreciate an example that shows loading a JSON HAL collection into an array of models/objects. Even more specifically I have a JSON file like this that I'd like to create an array of article objects from:
Otherwise, could complete JSON be provided along side the corresponding existing code examples? Thanks!