The ngResource module provides interaction support with RESTful services via the $resource service.
2
votes
1answer
215 views
Angular - resource object is sometimes undefined?
I have a simple app using Angular which feeds off of Tastypie REST resources.
I have a resource defined using a factory:
app.factory("Task", function($resource) {
return ...
2
votes
1answer
634 views
Integrate AngularJS App with SoftwareAG webMethods Integration Server
I have been trying to set up a sample AngularJS app with webMethods Integration Server on the backend. Using $resource, I can easily pull normal JSON files and manipulate the data within the file. ...
1
vote
1answer
24 views
Angular JS and Cross Origin Requests
I am just playing around with angular JS and wiring it up to some restful web services I have implemented. I have moved onto using the $resource module provided by angular and have a simple question ...
1
vote
1answer
835 views
AngularJs $resource.query() gives TypeError: href is null
I am using angular $resource.query to retrieve json data over REST. When I call the query() method a GET request is sent to the server and successfully retrieves the json data:
{
"_links" : {
...
2
votes
0answers
124 views
Fetch associations on create or save with Sequelize
Fairly simple problem, just cant find the good/clean way to do this without making a call to another find
I've got my node app rigged up with Angular-Resource, and I'm just making some round-trip ...
2
votes
0answers
75 views
AgularJS $resource cache doesn't work
I'm trying to add caching to a $resource in Angular, but no matter what I try (so far), Angular always ends up performing a full requests and the server happily returns a full response.
Simplified, ...
2
votes
0answers
77 views
Accessing params values inside a $resource param as a function in AngularJS
The API I need to connect is using oData ; I need to format the request parameters before sending the request.
So I found that I can use a function as a parameter, not sure it is a best way...
I need ...
1
vote
0answers
31 views
How do I restrict requests made by Angularjs $resource?
Let's say I want to create a resource that handles communication with a REST server, and more specifically, with a table of cards. I have it defined roughly like this:
$resource(... + '/cards/:id', ...
1
vote
0answers
188 views
Angular controller as vm not available in $resource.$save callback function, only $scope
I am having an issue in AngularJS when not wanting to use $scope but a controller instead in a callback function passed to $resource.$save() as parameter.
The controller code is shown below. This ...
1
vote
0answers
164 views
Nested data/children with Angular's factory $resource
I have a server side API method which returns an array of locations in JSON and have created a resource in Angular to retrieve the entire array of locations upon loading.
All locations also have ...
1
vote
0answers
195 views
AngularJS ngResource and IE9 issue: response.data is undefined in the error callback function
ISSUE: In IE9, when I call $resource.save, I get undefined on response.data inside the error callback function. In chrome, response.data has the "errors" JSON object returned from the server.
Here ...
1
vote
0answers
97 views
AngularJS: $resource returns syntax error
I would like to access the data provided by the following API: https://apps.finn.no/api/search/car-norway/?rows=1000&page=1
Question: How would I go about accessing the data using AngularJS?
...
1
vote
0answers
225 views
Using multiple $routeparams in a url string
Per this post, I am trying to use two parameters in an URL string to link to an individual result in a REST call:
Set URL to SEO Friendly Title with Dashes instead of ID
My list of articles and ...
1
vote
0answers
293 views
Angular: Resource in directive
I try to build a 'selectCategories' directive with AngularJS. The HTML element itself is more or less a simple select field but I want to load the options from a RESTful service. Therefore I built a ...
1
vote
0answers
165 views
How do you update a cached resource in an angular service?
What is a good pattern for updating angular data from a ngResource service that has been cached?
I been trawling posts like this one [1]: How to refresh / invalidate $resource cache in AngularJS, but ...
1
vote
0answers
41 views
$resource action encodes hash in parameters in a wrong way
I have an API. It has "filters" field and takes array of different filters. I want my resource to send request like:
...
1
vote
0answers
154 views
utf-8 URLs in AngularJS
My URL has some Arabic text in it. $location.path() displays the text correctly (decoded) but the browser URL is encoded and is not human readable.
How to make the browser URL display the correct ...
1
vote
0answers
218 views
Stack Overflow in AngularJSRailsResource during deserialization
I'm having an issue nesting resources, during serialisation due to the recursive structure of my data. I'm using AngularJS-Rails-Resource for my serialization. I can't tag this post as such because I ...
1
vote
0answers
332 views
Posting data and params using $resource using angularjs
I have a angular service which has custom methods like this
appServices.factory('RuleSets', ['$resource',
function($resource){
return $resource('', {}, {
query: {
...
1
vote
0answers
2k views
Angularjs — Using directives for data load or resolve
I'm working on a large mobile application and I've come across a debate. Currently I have the resources for the various rest api's wired into a directive which then loads the data into the scope at ...
1
vote
0answers
149 views
ngResource causes website to crash
I have a webapplication using angular.js with ngResource module to use the REST API on the server.
Here's how all the different urls are accessed:
this.getSomething = function () {
var deferred ...
1
vote
0answers
302 views
Fetching Multiple CRUD-able Objects From Single AngularJS Resource
How can I request a group of database entries from a AngularJS's $resource, which will allow my to modify and $save() the individual objects?
I have the following code fetching my data:
var ...
0
votes
0answers
7 views
How exactly means this $resource web service connection configuration in AngularJS?
I am absolutly new in AngularJS and I am studying a tutorial that show how to access to this external weather forecast API: http://openweathermap.org/forecast to retrieve and use weather information.
...
0
votes
0answers
28 views
Angularjs $resource Cache
I have a more generic implementation of $resource as "Datarepository" factory in my application and all the REST API calls calls this factory to do the "REST" operation
...
0
votes
0answers
38 views
AngularJS DELETE with Tomcat causes 405 Request method 'DELETE' not supported
I'm using Spring Data Neo4j Rest backend served on Tomcat (8.0.27) with Angular frontend, all served locally at http://localhost:8080/. When I try to delete a record with either $http.delete() or with ...
0
votes
0answers
18 views
Expected response to contain an array but got an GET
I researched this question everywhere but no solution is working for me.
like this: Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object?
...
0
votes
0answers
18 views
AngularJS nested $resource
I have these tables:
Rooms
ID
name
description
beds
Beds
ID
room
name
size
I have this code so far:
(rooms-list-controller.js)
angular.module('apiRoomsModule').
controller('RoomsList', ...
0
votes
0answers
64 views
API working in browser but not working from angular js code displaying CORS issue
I am trying to integrate API from freshdesk, which is giving json output while using in browser. When used in angular js code, browser is showing CORS issue.
In API service:
function ...
0
votes
0answers
178 views
AngularJS $resource params WebAPI
Here is my WebAPI controller
[Route("~/api/v1/Employees/{id}")]
[HttpGet]
public HttpResponseMessage GetEmployee([FromUri]int EmpID)
{
var emp = ...
0
votes
0answers
66 views
Angular JS Resource CRUD example
Here is my factory..
var resource = {
employee: function () {
return $resource('../../Employee/GetEmployee/:EmpID', { EmpID: '@EmpID' },
{
show: { ...
0
votes
0answers
96 views
angular js content not wrapped inside the return resource object
I have a service class in angular that calls my backend and gets a userInfo as an object. My angular service class has the following.
var userResource = $resource(coreURL+'getFullProfile', {}, {
...
0
votes
0answers
176 views
AngularJS and Twitter API
I'm trying to create a custom Twitter feed for a website that I have, with AngularJS. So far, I think I have the authentication correct. I just can't seem to understand how to pull and display the ...
0
votes
0answers
89 views
combined controller for parent / child resulting in “undefined is not a function”
Trying to combine the delete of a 1:n listed items (parent 1->n children) into one controller, I get the following error:
TypeError: undefined is not a function
Form sniplet:
<tr ...
0
votes
0answers
228 views
AngularJs $resource delete request with body
Hi I know this question was asked many time but I did not found an answer to it.
How do I send a call with AngularJs $resource delete method to Web that have a body? I was not able to do it. I've ...
0
votes
0answers
44 views
Angular $resource static model method
Say I have an AngularJS $resource defined like this:
angular.module('app', ['ngResource'])
.factory('PanelUser', ['$resource', function($resource) {
return $resource('/api/panel/users/:userId', ...
0
votes
0answers
105 views
Determine which $resource query failed when executing multiple ones asynchronously with $q
I want to execute multiple angular $resource queries in parallel. I then want to know which queries were successful and which were not. Here is, what I want to achieve in pseudocode:
query resource 1
...
0
votes
0answers
53 views
Using Angular $resource ($update Put)
I am pretty new to angular and i have a project is using angular $resource. I am trying to do an update operation. This is the code:
My Service
'use strict';
app.factory('settingsService', ...
0
votes
0answers
341 views
angularjs DELETE array of objects
Please help me understand: why angularjs not delete array of objects
$scope.removeAll = function(
all = _.pluck($scope.uploader.queue, 'file');
all.length && ...
0
votes
0answers
81 views
ng-grid does not refresh with $resource service
ng-grid is not updating my list.
I am trying to create a object in one view and on creating I redirect my page to list view where i want to see all my added objects. I am able to create a new object ...
0
votes
0answers
857 views
JSONP in AngularJS resourse - No 'Access-Control-Allow-Origin' header is present on the requested resource
I'm trying to rewrite my code using factory:
My current code:
$http({ method: "JSONP", url: url}).success(function(data){
$scope.albums = data.entries;
});
is ok
But my new code:
...
0
votes
0answers
46 views
How should I inject a CurrentUser into a controller
I'm very new to angular and trying to create a controller that will get all of the Snods that belong to the current user. I have included my CurrentUserController for reference but my question is ...
0
votes
0answers
245 views
How to send parameters to a $resource inside a Factory on AngularJS
I've got an AngularJS factory which provides a $resource connected to an API. Something like this:
app.factory('Collection', function($resource, Global){
return $resource(
...
0
votes
0answers
332 views
Angular resource dynamic uri
Once I was using $http in calling all my apis' endpoint. But lately I read that using $resource is much more robust or best practice. Now I'm migrating all my $http call to $resource and I got bump on ...
0
votes
0answers
325 views
AngularJS merging resources with domain objects
I have a domain model for our new JavaScript application.
It is designed to be used against any framework; not specific to AngularJS.
However when I try and incorporate it into my application I am ...
0
votes
0answers
204 views
After changing the angularjs in my application I am getting error
I developed an application which uses 1.0.1 version : https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js
Now I need to use latest version as to use new functionality so I tried ...
0
votes
0answers
543 views
How Can I send a POST request with JSON data using $http or $resource in AngularJS?
I want to send a request to the server with postData.(JSON)
I tried the following $http request,
var jsonData = {"id": 1,
"name": "xxx",
"designation": ...
0
votes
0answers
367 views
angular js: resource is returning array however expecting string
I have a Rest service which returns the contents of html fragment as below.
<!-- VIGNETTE -->
<section class="vignette" xmlns="http://www.w3.org/1999/xhtml">
<hgroup>
...
0
votes
0answers
225 views
Angularjs and IE10 no post data when saving resource
I'm having trouble figuring out why my models are not getting saved in AngularJs when using IE10. It is working well in IE8, 9, Chrome and Firefox. The problem I am seeing using Fiddler is that no ...
0
votes
0answers
96 views
AngularJS adds extra &
I want to pass a stringified JSON as an argument but Angular keeps adding extra & at the end of my query. Which is causing me headache.
Here is how I call it:
$scope.products = ...
0
votes
0answers
424 views
Query using $resource in AngularJS
I want to make a query using a $resource in AngularJS such that I use a secondary characteristic of the table. I have a $resource which will give me all the Tweets... (all in coffeescript)
...