-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I am using angular-hypermedia with HalResources, I have set this as the default for my HalContext.
When I do a post using the following:
provider.$linkRel('create-client', halResource).$post({ data: 'data' }).then(function(response){
console.log(typeof response.data)
})
The typeof the response.data is a Resource, and not a HalResource as I expected.
Two questions:
-
Should angular-hypermedia be updated to return a HalResource from a post when this is the expected factory.
-
I am struggling to create a HalResource from the Resource, there seems to be some unexpected side affects, I keep getting httpPost on context undefined when using:
new halResource(createdClient._links['create-invoice'].href, myContext).$linkRel // (or $post)
The console error is :
angular.js:13645 TypeError: this.$context.httpPost is not a function
at HalResource.value (http://localhost/app/providers/jspm_packages/npm/angular-hypermedia@1.0.0/dist/hypermedia.js:934:30)
The code at location being,
$post: {value: function (data, headers, callback) {
return this.$context.httpPost(this, data, headers, callback);
}}
Where to from here?
Metadata
Metadata
Assignees
Labels
No labels