Questions tagged [angularjs-ng-resource]

The ngResource module is part of AngularJS and provides interaction support with RESTful services via the $resource service.

The ngResource module is part of AngularJS and provides interaction support with RESTful services via the $resource service.

Link to the API: https://docs.angularjs.org/api/ngResource

57 questions
0
votes
1 answer

chaining query with $resource

I have the following service which uses ngResource to set my syllableCount be clicking a button. //Words service used to communicate Words REST endpoints (function () { 'use strict'; angular .module('words') …
d8ta
  • 167
  • 2
  • 13
0
votes
3 answers

Angular js resource call to get json data in array

Created factory that will return json data and calling it from controller, but it is coming empty. don't know where I made mistake. no console error and in network json is also loading. 'use strict'; var app = angular.module('angularJson',…
0
votes
0 answers

Using ng-animate-ref with asynchronous data

I have an angular app that uses $resource to load data into the views. I used ngAnimate's ng-animate-ref to transition an image from one view to another. This worked fine when the data was hardcoded into the controller, but when I use $resource or…
Alex Wohlbruck
  • 1,340
  • 2
  • 25
  • 41
0
votes
1 answer

$resource error even after adding dependency to ngResource

I am trying to display data in an angular app using $resource, from mongolab. I added dependency to ngResource in the module. Still it says Unknown provider. What is the missing point here? '$resource is not defined' Note: When my factory name was…
LCJ
  • 22,196
  • 67
  • 260
  • 418
0
votes
0 answers

Make an object for angularJS controller using $resource (factory|service)?

My approach is using AngularJS Service instead of factory along the project. Now I want to build an object called MyData which should be used as array in angularJS controller, such as: vm.datas= MyData.query({}, function (datas) { …
0
votes
1 answer

Access propertyname while looping through an object

As you can see in the code I provided in this question, I try to loop over the properties of an object. All properties are empty objects! I also have another object where I stored a couple of rest-calls (ngResource Stuff which is not important for…
0
votes
1 answer

Using Angular Factory Service

I'm trying to follow Code School's Staying Sharp with Angular Soup to Bits. I've come to the point where I've created a note factory service and implement the $resource service. I $scope.notes = Note.query() and then console.log($scope.notes) but…
gh0st
  • 1,653
  • 3
  • 27
  • 59
0
votes
1 answer

How to call specific get method in web api using agluar ng-resource?

I have two or more get methods in web api, (as per below give code GetProducts and GetProductsNew are get methods). As i am using the ng-resource of angular js, whenever i try to call get function, it is giving an ambiguous error. Suppose i want to…
0
votes
1 answer

Edit data before sending with ngResource

Hey I want to change the data before sending it with ngResource (build FormData object). I do everything as in the examples that I found, however I can't make them work. Here is my code: My controller where I set the data and try to send them: …
0
votes
1 answer

Saving an ngResource with additional query string parameters

I have a resource in my API called /foos. I can create a new Foo by making a POST request to this URL. In the client I use Angular's ngResource to deal with API calls. Insertion is easy: var newFoo = new Foo({param1: 'value1'}); newFoo.$save(); So…
cafonso
  • 909
  • 11
  • 18
0
votes
2 answers

Angularjs $resource dynamic headers with $save

I am trying to add dynamic headers to a $resource like so: angular.module('app') .factory('API', function ($resource, API_URL) { return { event: function(userId){ return $resource(API_URL + '/event/:id', { id: '@id' }, { …
0
votes
1 answer

refactoring "factories" into a $resource

Hi I have converted a previous function for editing records in an api into the following resource: app.factory("Wine", function($resource){ return $resource("http://greatwines.8000.com/wines:id", { //id as a variable id: "@id" …
HGB
  • 2,157
  • 8
  • 43
  • 74
0
votes
1 answer

need angularjs ng resource and ui router sample to handle spring data rest relationships

There are plenty of examples of using ng resource and ui router for basic crud operation, but I don't find any project code samples for handling rest calls related to relationships (one to may, etc). Can any one give me references for handling one…
0
votes
1 answer

ERR: [$resource:badcfg] query when testing a resource service with Jasmine

When testing my REST service I'm getting the following error message: Error: [$resource:badcfg] query http://errors.angularjs.org/1.4.6/$resource/badcfg?p0=array&p1=object&p2=GET&p3=http%3A%2F%2Flocalhost%3A63831%2Fapi%2Fnames in…
yuro
  • 2,189
  • 6
  • 40
  • 76
0
votes
1 answer

Angularjs, ui state routing to access spring data rest uri is going wrong

I have my spring data jpa resource and repositories are as shown below : In my Student.java, I have @ManyToOne private Teacher teacher; StudentResource.java @RequestMapping(value = "students/byTeacherId/{id}", method =…