The AngularJS ngResource module provides interaction support with RESTful services via the $resource service.
Questions tagged [ngresource]
525 questions
0
votes
0 answers
Saving data via PUT request $resource angular.js
Forgive me if this has already been asked and I have missed it but this has been bugging me all weekend and I do not know what I am doing wrong. I am trying to make a PUT request using the $resource service in angular.js with the ngResource module.…

StujayH
- 69
- 1
- 9
0
votes
2 answers
Is it possible to use repeating params in ngResours query
I'm using Angular with ngResource and i've got an api url:
GET http://my.com/rest/items?inState=TRANSIENT&inState=FINAL
How could I do query with two (not uniq) params 'inState'?
This is my Resource factory:
.factory('Resource', function…

S Panfilov
- 16,641
- 17
- 74
- 96
0
votes
1 answer
ng-resource does not recognize parameters
I'm using ng-resource to access an API in the following way:
$resource('http://' + config.server.api + config.server.host + base_url + '/:id', {
'id': '@id'
},{
'get' : {
method : 'GET'
},
'add' : {
method :…

BarakChamo
- 3,321
- 5
- 30
- 38
0
votes
1 answer
ngResource, pass params into transformRequest function
Given:
Users = $resource apiUrl+"/v1/users/?offset=:offset&limit=:limit&format=json", {},
getNext:
method: 'GET'
Users.getNext { offset:20, limit:20 }, (data)->
console.log "got some data"
Instead of explicitly passing offset…

iLemming
- 34,477
- 60
- 195
- 309
0
votes
1 answer
angularjs infinite request loop for $resource
for some reason when I hit a certain route in angular I crash the browser and my node server freaks out making tons of requests:
GET /bower_components/bootstrap/dist/js/bootstrap.js?_=1402331354670 200 3ms - 53.96kb
GET /js/app.js?_=1402331354671…

Connor Leech
- 18,052
- 30
- 105
- 150
0
votes
1 answer
How to use restful instead of query syntax for this $resource factory?
So I've got a $resource factory like so:
(function() {
'use strict';
app.factory('WidgetFactory', [ '$resource', function($resource) {
return $resource('http://localhost:8282/widget/:widgetId', { widgetId : '@id'},{
…

FlavorScape
- 13,301
- 12
- 75
- 117
0
votes
1 answer
Difference between resource.save() with callback and $promise in ngResource using AngularJS
This is my factory:
// Factory
app.factory('BuildingListService', ['$resource', function($resource) {
return {
selectBuilding: function(building, callback) {
return $resource(window.appSettings.context+'/requests/building')
…

njfife
- 3,555
- 1
- 20
- 31
0
votes
2 answers
ng-repeat doesn't auto refresh after save
I am trying to post some data via save but cannot see the data in the browser unless i refresh, the todo.id is showing straight away but not the todo.name
…

kam
- 425
- 2
- 6
- 24
0
votes
1 answer
Issues using $resource without the new operator
I'm trying to use Angular promise API in my app. And I was a little confused. I created a factory like in code below
factory('transport', function ($resource) {
var baseUrl = "http://aw353/WebServer/odata/Payments";
return $resource("", {},
…

alinaish
- 456
- 2
- 7
- 18
0
votes
2 answers
PHP not receiving post from $resource AngularJS
I have a factory service in Angular that is successfully posting my email in the HTTP request which I have verified with Firebug, but the email is not being seen by my PHP file. I am reaching my PHP file since I can echo a response from it, but the…

appthat
- 816
- 2
- 10
- 30
0
votes
0 answers
AngularJS MVC4 not working with ngResource
I'm new to Angular. The demo project I'm working on does not like my changes to use ngResource (instead of the $http or $q promise syntax)
When I click on the Courses link in the Registration.html below it begins calling the angular controller over…

D. Kermott
- 1,613
- 17
- 24
0
votes
0 answers
$resource gets an invalid URL
All,
I'm having some trouble with $resource calls in my angularjs app. I've spent a couple of days looking for answers and from what I can see my code should work but it just doesn't. I would be truly grateful if anyone could explain to me what the…
0
votes
2 answers
AngularJS ng-switch before load
I have an AngularJS template that looks like this:
No data available. |