johndgiese / angular-hyper-resource Goto Github PK
View Code? Open in Web Editor NEWAngularjs module that provides HAL extensions to $resource
License: Other
Angularjs module that provides HAL extensions to $resource
License: Other
In your list of examples, you specify that it's possible to do something like: books.query()
but am not seeing the support if you return an actual collection of embedded entities:
The following test fails with Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object
:
describe('collections:', function() {
var Book;
beforeEach(function() {
Book = hResource('book', '/books/:id', {id: '@id'});
});
it('returns an array of entities embedded within a collection', function() {
var response = {
_embedded: {
books: [
{
id: 1,
title: 'The BFG'
},
{
id: 2,
title: 'Matilda'
},
{
id: 3,
title: 'James and the Giant Peach'
},
]
},
_links: {
self: {
href: '/books'
}
},
count: 3,
total: 10
};
$httpBackend.expectGET('/books').respond(200, response);
var books = Book.query();
$httpBackend.flush();
expect(books).toBeArray();
});
});
I'm currently working on the client-side code for my services without connection to them, and I have a line like
new ResourceContext(HalResource).get(myRoot).$get()
which throws me an response.headers is not a function
error. What's the correct way to handle these, a .then
error handler?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.