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

Testing Angular resource in Karma fails with "Expected [ ] to equal [ ]"

I'm trying to perform a very basic unit test on an Angular resource: describe('coupons.resource', function () { var Coupons, $httpBackend; beforeEach(function () { module('coupons.resource'); inject(function (_Coupons_,…
0
votes
1 answer

ng-resource method query() not successful while server answers with status 200

I have created two resources angular.module('myApp.services', ['ngResource']) .factory('Banana', function ($resource) { return $resource('http://localhost:8080/banana/:bananaId'); }) .factory('Mango', function ($resource) { return…
JCvanDamme
  • 621
  • 5
  • 20
0
votes
2 answers

Angular remote form not displaying error

I have created an angular form that displays input validation errors received from the server. My solution works fine except for one small issue. If I submit the form with no value, after the page loads, I am receiving the correct response from my…
HermannHH
  • 1,732
  • 1
  • 27
  • 57
0
votes
2 answers

TypeScript / AngularJS - Using ngResource Service

I have a hard time initialising a new resource object. Retrieving data from the REST API works just fine. The error gets thrown at the following line of code: var newRoom = new this.lobbyStorage.LobbyRoom(); with the following…
0
votes
2 answers

Angular ngResource's $save() not working

I want to post data to my asp.net webapi controller, by using $save() method that belong to ngResource i am getting this error: "TypeError: $scope.product.$save is not a function at n.$scope.saveProduct " when i used $http(), data is getting saved…
0
votes
1 answer

$stateparams is not changing in the services Even if it changes outside the factory

var routerApp = angular.module('routerApp', ['ui.router','ngResource']); routerApp.config(function($stateProvider, $urlRouterProvider) { $stateProvider // HOME STATES AND NESTED VIEWS .state('partyDetail', { …
0
votes
1 answer

dynamically allocate the id in the URI in the ng-resource

I have a webpage created on the angularjs in which I have used the ng-resource and the ui-router module. In this app The main requirement I want is that in the navigation bar, I have created the ng-repeat="". which fetches the username from the…
0
votes
1 answer

ngResource get() does not appear to retrieve any data

The angular code is below along with the html. The problem is that the endpoint '/contacts/:id' returns json in Postman and Chrome. Obviously I swap :id with 0037000001pIldUAAS for those tests, but the endpoint seems to be good. When the page is…
Tony Evans
  • 163
  • 2
  • 10
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
-1
votes
1 answer

Ionic Application Development - White Screen of Death Issue

I have just started learning Ionic and Angular. After reading basic documentation related to Angular and Ionic, I was following the tutorial from this site to develop the sample application myself. I am able to load the application and see the data…
-1
votes
2 answers

AngularJS: ngResource 500 internal server error

I have a problem in getting list of users using $resource. I am making a webservice call using $resource to get list of users. It works most of the time, but when ever the response takes some time I am getting 500 internal server error. The code I…
Raja
  • 1
-2
votes
1 answer

Angular ngresource and different promises

I'm working on a twitch app. I know it could have easily been done with $http but I decided to try it with ngresource. The problem I'm having is with the offline tab. The users are showing but not the logo or username. I know it's because the stream…
1 2 3
4