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
1
vote
0 answers

angular .$save is not a function

My project is base on ionic framework, and I am using ngResource in project. Now my requirement is that I want to pass the url dynamically to that ngResource function. For this I create one wrapper for this. And its working properly with get, put,…
RahulSalvikar
  • 658
  • 1
  • 10
  • 31
0
votes
1 answer

AngularJS How do I get data from a URL requiring both querystring parms and post data using angular resource?

Requirement: Send data to an endpoint using a post of data and put the startdate and endate into the querystring of the url, like this: https://server/byLocation?startDate=2019-01-01&EndDate=2020-01-01 The data payload only has the locationIDs and…
JWP
  • 6,672
  • 3
  • 50
  • 74
0
votes
1 answer

AngularJS Failed to load resource: the server responded with a status of 403 ()

Frontend code var app = angular.module('myApp', ['ngResource']); app.controller('UserController', ['$scope', '$resource',function($scope,$resource) { $scope.deleteRec = function(username) { …
Vignesh_E
  • 167
  • 2
  • 4
  • 15
0
votes
1 answer

how to delete record in spring mvc using angularjs request

frontend code var app = angular.module('myApp', ['ngResource']); app.controller('UserController', ['$scope', '$resource',function($scope,$resource) { …
Vignesh_E
  • 167
  • 2
  • 4
  • 15
0
votes
0 answers

Unable to catch the success response IE

I have an application wherein it should work both in chrome and IE. API call using resource(ngResource) is working fine in chrome/Firefor - able to get response in success block when api is success. But in IE11 same api is going into error block.…
0
votes
1 answer

How to access params to get a single object in $resource?

So I am trying to get a single "post" object from a list of posts but i don't know the name of passed params object name. Here's post-details component 'use strict'; angular.module('postDetail', ['ngRoute',…
Kamran Arshad
  • 81
  • 1
  • 16
0
votes
1 answer
0
votes
0 answers

Difference between AngularJS standard $http and NgResource

Who can tell me at least 5 differences AngularJS standard $http and NgResource? Expect that NgResourse is better for RESTfull Api.I searched for this but didn't find a good answer:(
rebilliony
  • 177
  • 10
0
votes
1 answer

How to test $resource calls if it contains specific headers on making http request?

I have this following factory. services.factory('Api', ['$resource', function ($resource) { return $resource(urlPath, { 'action': 'get', 'entity': 'Entity' }, { MakePost: { method:…
bmnepali
  • 446
  • 11
  • 20
0
votes
1 answer

How can I create a custom query using $resource that passes arguments to the find method in mongoose as req.body?

I want to use a custom query method like this: $scope.modules = dataFac.getModules().customQuery({name: /test/}) .$promise.then(function(response){ $scope.modules = response; }, …
0
votes
2 answers

Sending data from Angular 1.x Factory to Angular 1.x controller

I have a service defined which do the db related queries/updates. I have defined the controller which does the data parsing for the angular elements by getting the objects from the service. I would like to keep each scope different How can I pass…
rcreddy
  • 95
  • 7
0
votes
3 answers

How to abort or cancel an Angularjs $resource request and override the response by a local data

In one of my new projects I am using AngularJS $resources for http calls. I have requirement to show local data (from SQLite) when there is no internet connection. I have clustered my obstacles by the following steps, and created sample code down…
0
votes
1 answer

ngResource ($resource) is returning 404 for PUT

It's been a while since I've used $resource for managing my service calls. For some reason, all my calls are working ok and reaching my REST end-points, basically /api/profile and /api/profile/:id. But for some reason, my put returns as 404. Anyone…
cnak2
  • 1,711
  • 3
  • 28
  • 53
0
votes
1 answer

AngularJS Restes Form after API Callback

in my code I have a Factory with ng.resource: .factory('company', function($resource){ return $resource(appHelper.apiPath('auth/company/info'), {}, { update: { method: "PUT" } }); }); If I submit the form in my Controller everything…
ghovat
  • 1,033
  • 1
  • 12
  • 38
0
votes
1 answer

Sequentially ngresource calls

I have a controller making two $resource calls against two REST services where the result of the first one is used as input by the second one. Here the code: if (requestLock == false) { $scope.T_01_04_sharedData.tempRequestForT_01_04 =…
Pietro Fragnito
  • 327
  • 1
  • 4
  • 18