The AngularJS ngResource module provides interaction support with RESTful services via the $resource service.
Questions tagged [ngresource]
525 questions
0
votes
1 answer
angularjs resource not making any api calls
Below is my resource call, but it is never making any call. I cannot see a request in my server. What i am doing wrong here?
myfactory:
userAccountApp.factory('dataSer',function($resource)
{
uData = {}
uData.Users =…

mithu
- 223
- 6
- 17
0
votes
1 answer
change the param value in $resource
I want to build an resource with this kind of URL :
/api/v1/users?userType=PREMIUM¶m2=value2
I have resource with the following configuration :
return $resource("/api/v1/users?userType=PREMIUM¶m2=value2, {},
{ 'get' :…

user583726
- 647
- 2
- 9
- 20
0
votes
1 answer
Allow dynamic parameter name for Angular ngResource call
I'm trying to use a custom Angular directive with a custom attribute, i.e. :filterBy=:filter. This is being done with a custom directive like this:
The service:
function Foo($resource) {
return…

taco
- 1,367
- 17
- 32
0
votes
2 answers
POST parameter to web api being set as null
I'm trying to use ng-resource to POST a value to my web-api and get the value back in javascript.
While the request seems to go through alright, the parameter being passed to my function public string AddOrder([FromBody]string order) seems to be…

TomSelleck
- 6,706
- 22
- 82
- 151
0
votes
0 answers
Angular resource query not recognised as array
I have a resource to access my stores location
appServices.factory('Store', ['$resource', function($resource){
return $resource('/backend/store',
{},
{
'query': { method:'GET', isArray:true}
});
}]);
I try to…

poiuytrez
- 21,330
- 35
- 113
- 172
0
votes
2 answers
ngResource treating POST like GET
I noticed that although I specify "post" on my ngResource factory, it is passing parameters as GET.
Example of a user factory:
myApp.factory('facUser',['$resource', function ($resource) {
return $resource('/api/User/:route', {}, {
…

ADL
- 2,707
- 1
- 16
- 23
0
votes
1 answer
angular $resource methods dont send the right value
this is my service
.factory('ProductData', ['$resource', function($resource) {
return $resource('product/:id', {id: '@id'}, {
'update': { method:'PUT' },
'insertNew': { method:'POST' },
'delete': { method:'DELETE' },
…

devilbone
- 17
- 6
0
votes
2 answers
Trouble modifying ngResource result
I had the following in my code:
function store() {
this.products = [
new product("sku001", "Apple", "Tasty stuff", 1.00, "local"),
...
];
This worked fine for displaying all the products:
Products
Display…
TomSelleck
- 6,706
- 22
- 82
- 151
0
votes
1 answer
How can I update the $scope in AngularJS when a server sided update occurs?
Background
I am trying to make a single page real-time application that uses a PHP , MYSQL back end and AngularJS frontend
My back end is using CakePHP framework which serves a JSON API and the front uses ngResource in AngularJS to access this…

Arithran
- 1,219
- 3
- 11
- 22
0
votes
1 answer
MEAN stack and ngResource - don't understand how to pass url resource ids
I am trying to build a little app with the mean stack and I have been struggling with this problem for days now. The app is pretty straightforward, I can create Quizes, then create questions that pertain to those quizes.
The different REST URLs are…

user2031269
- 15
- 1
- 6
0
votes
1 answer
CROS-ORIGIN request with ngResource on mobile
When I send request with desktop browser I work just fine but when I send when mobile response is like this:
Here is my resource code:
app.factory('Category', function($resource) {
return {
get:…

Aryan
- 2,675
- 5
- 24
- 33
0
votes
1 answer
Angular ngResources request interceptor
Why angular $resources not have a request and request error interceptor?
Theres any way to do that?
Doc content:
interceptor - {Object=} - The interceptor object has two optional methods - response and responseError. Both response and responseError…

Marcelo Aymone
- 293
- 3
- 19
0
votes
1 answer
Angularjs Rest endpoint with username password
I am trying to write a Single Page App (SPA) based on AngularJS. The app should connect to a webserver that provides a RestFul services, but each end point requires username and password along with other parameters. Since I am a beginner in this…

Mohitt
- 2,957
- 3
- 29
- 52
0
votes
0 answers
AngularJS: value argument of $resource.save callback is a Resource
I am using AngularJS' $resource directive to implement a REST interface on the client side. The server side's implementation works flawlessly. However, on the client side I am stuck. On the data side I have a materials model which holds an array of…

Bastian
- 4,638
- 6
- 36
- 55
0
votes
1 answer
Problems with angular-ui-router - I cannot apply a filter to a repeat in a directive
I have an issue that only occurs when I load directives as part of a angular-ui-router state. When I add the directives directly to index.html everything works as expected.
Here's a plunker that demonstrates the issue I'm…

Matthew Lucas
- 443
- 1
- 5
- 15