AngularJS tag for $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.

learn more… | top users | synonyms

-3
votes
1answer
24 views

How to display response data ($http) from server in AngularJS

How to display reponse data (get) from server in AngularJS in my code I need to alert $scope.orders inside that controller but it willll not show.. function OrderController($scope,$http) { var ...
0
votes
0answers
10 views

directive with inline tpl containing ng-include

I have a directive with inline template containing a ng-include directive element. When karma testing my directive and logging the result of compiled element . the tesult contains a ng comment ...
0
votes
1answer
25 views

Angularjs controller fails to load http data from cachefactory service

Newbie to angular, using service I'm trying to load cachefactory and using the cache from controller. Here is service methods codesApp.service('CodeFilterService',function($filter, $http, ...
0
votes
2answers
27 views

$http.post not sending variables

Am I doing something wrong? When I do the following I receive no post variables in /url $http.post("/url", { something: "something" }) .success(function(data) { console.log(data); ...
1
vote
1answer
34 views

SP.ClientContext on host web failed because of Cross Origin Resource Sharing (CORS)

I have a problem with a SharePoint-Hosted App (App for SharePoint) developed by me. SharePoint version is 2013. The app web is: http://app-12a34567bcde8f.sharepoint.local/sites/DEV/HelloWorld The ...
0
votes
0answers
23 views

angularjs while Posting multpart data its getting converted to string

while sending POST request with multipart data with image and other fields in angularjs , boolean values getting converted to string how to resolve it. var fd=new FormData(); ...
0
votes
2answers
35 views

Return value from nested http.put

How to return response object from http.put to controller as return value from TestFunction? response from http.get is printed OK but putResponse is undefined. During debug I can see that http.put ...
-1
votes
1answer
27 views

Scope of $http callback in ES6

I'm trying to write a quick test that uses ES6 and Angular to call an API - but I can't quite work out how to scope the injected values into the callbacks - in all cases they seem to be completely ...
2
votes
3answers
42 views

FileReader JS Api Call Fire before it's ready

I'm trying to read a file, create a "FileContainer", and a DataUrl from a fileReader so i can send it to a web api. My problem is that the Api call fires before my object is created, so i send Null ...
0
votes
1answer
62 views

HTTP headers are not being sent in CORS GET from AngularJS application

My problem is that HTTP headers are not being sent from my AngularJS HTTP GET requests. However, for a HTTP POST, I do see the headers being set. These HTTP requests are over CORS. Although there are ...
5
votes
1answer
44 views

Run a hook before $resource constructs the url?

I want to programatically alter route parameters before $resource constructs the url. I cannot use angular's http interceptor to do this, since the route is already concatenated at that point. Given ...
0
votes
2answers
38 views

Web Method in aspx page not getting executed

I am trying to make an ajax request on page load itself.I am using angular js $http service to get Json data from the web method which is present in my User.aspx.cs page . My Web Method is follows.: ...
0
votes
2answers
95 views

how to prevent duplicated $http requests in AngularJS app?

Really i need to prevent repeatedly send the same request before the previous request will give the the response . I have found out some solutions. somehow i don't need to disable the button while ...
0
votes
0answers
21 views

Getting http response through hurl.it, but not through angularjs http post

Getting response in hurl.it, but not through angularjs http post. The error message is: Mixed Content: The page at .. was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ...
1
vote
0answers
33 views

AngularJS http interceptors responseError never called with IE9

I'm confronted with a problem with $http.get configured with a timeout with IE9 only. When the request is aborted, my http interceptor is never called. Has anyone else also confronted this problem? ...
1
vote
2answers
55 views

Is it possible to have an Angular js $http request inside another request?

I am trying to send a request in AngularJS to get a token for user registration. Once I get the token, I am sending another request using the token to register the user. However the first request ...
0
votes
0answers
43 views

$http status 0 angularJS

I'm developing a mobile application using ionic and angular. I have a problem when invoking $http post function sometimes it works but sometimes it does not. When it does not, it return status 0. It ...
0
votes
2answers
35 views

Refer to service in run immediately after definition?

I would like to attach a string from a service to every request. Attempt: 'use strict'; angular.module('main') .service('Foo', function () { self.bar = 'haz'; }) .run(function ...
0
votes
2answers
94 views

Output page blank while fetching data from JSON file in AngularJS

I have just started learning angularjs, I'm trying to load data from my json file on view. json file has a list of houses. But does not get showed on my view when I load the index.html file. ...
2
votes
1answer
35 views

Random sequence of response in $http.get

I'm trying to write a function that sends multiple requests to the server based on the number of Ids in the idArray. The problem I'm facing is that the data that is pushed into the dataArray does not ...
1
vote
1answer
64 views

AngularJS $http setting headers

I'm trying to set http in AngularJS, but it seems I'm doing something wrong. app.controller("mainCtrl", function ($scope, $http) { $http({ method: 'GET', url: '***', ...
0
votes
0answers
23 views

How to determine connection error reason in Ajax call

I found that a few clients where getting errors from an Ajax request in JS. The backend application is not getting the requests so I need to determine at which point in the connection proccess the ...
1
vote
1answer
233 views

AngularJS spring security login/logout with Cross-Origin Resource Sharing (CORS)

Problem Statement: My UI app is running on 9000 port(grunt project) and my server side spring boot project running on 8421 port. I am able to hit all the URL's from my UI app except login and logout. ...
1
vote
0answers
82 views

form not submited properly in angularjs with struts2

I am using struts2 framework with angularjs.There are two buttons one for reset the texts fields with default value and other is to submit the page. my submit is not working. My jsp page is:- ...
1
vote
1answer
46 views

$q.all with nested promise also created with $q.all

The following function tries to return a promise that will only resolve when all the async HTTP calls have finished: $scope.saveThat = function () { var promises = []; for (var i = 0; i < ...
1
vote
2answers
27 views

data.data for reading my json

I have this factory: 'use strict'; angular.module('testCon').factory('UserService', function ($http) { return { getAll: function () { return ...
1
vote
2answers
90 views

use $http.get in a service/factory to return a collection

I try to use a http.get promise in an angularjs service, do some manipulation on the obtained collection and finally return it to a controller... My question is how to use a $http.get() in a service ...
1
vote
2answers
58 views

How to use $routeParams in resolve

I use $routeParams like this right now: My factory function: angular.module('fifaApp') .factory('FifaService', ['$http', function($http) { var sdo = { getTeamDetails: ...
1
vote
1answer
64 views

AngularJS : How to get returned value from factory

I am very much new in AngularJS and I have the following problem: View: <div> <form role="form" name="loginForm" class="form-horizontal login-form"> <div ...
-1
votes
1answer
91 views

How to load returned html after $http.post

Sorry if this has been asked already, but I can't find an answer! I'm posting what could almost be form data using angular, and expecting the backend to return an html page. How do I load that page? ...
2
votes
2answers
28 views

Getting asynchronous data from service

I try to request some data in a service. I wanna make sure sure that the data is saved in a variable of the service, since due to state changes, my controller will reload all the time and I need the ...
3
votes
3answers
815 views

How to pass client-side parameters to the server-side in Angular/Node.js/Express

Probably a very basic question, but I cannot seem to find a simple answer. I have a GET method leveraging Angular's $http that is requesting a promise from a particular url (URL_OF_INTEREST). On ...
1
vote
1answer
47 views

AngularJS Get Method Not Work

I have an angular application, and I am trying to get a list of users from the server. I ran into an issue. I have page call CurrentUsers. If CurrentUsers method returns a Json Object, the entire ...
0
votes
0answers
40 views

Use Pace.ignore() function with AngularJs

I managed to use pace.js in my angular application. Now I want to hide the loading bar for specific $http calls. I wrap the call with Pace.ignore() but the loading bar still show up... Code : ...
1
vote
0answers
111 views

Angular $http get failing on json data with forward slash

My Angular get request fails when the JSON data I retrieve contains forward slashes in the data. I'm not sure how to handle such data as specially as I am using $http.get. Here is the related code: ...
-1
votes
0answers
40 views

Are http response headers being cached by the browser?

I am working on a project where I've had an issue with authentication tokens in response headers, they seem to be cached by the browser. We use openid, so set a http header called x-token, which is ...
0
votes
0answers
27 views

httpInterceptor rejection loses statusText

I have aproblem where is loose the statusText between the promise calls/rejection. How can i retain and pass on all the infromation from http interceptors event down to the service in which initiated ...
1
vote
2answers
133 views

Getting CORS error in AngularJS

I am trying to hit an https based API, which is successfully working in POSTMAN and other REST client, but not in my AngularJS app. Following is the code - var req = { method: 'POST', url: ...
0
votes
2answers
97 views

chained angularjs $http requests within for each loop

I need to check when the "for loop" function has finished for all $http requests processing and can refresh the data grid, once and for all. Currently, the refresh happens for every $http request, ...
1
vote
1answer
91 views

Angular Service/Controller not returning promise?

so I finally got my app working to where it gets the right URL for the JSON request. However now I can't get it work with that URL. I understand that the service is returning the promise from the ...
0
votes
1answer
267 views

Storing HTTP Response as a Controller Variable

I'm wondering if there's a way to take an $http response and store it to a controller variable as opposed to the $scope. For example: app.controller('testController', function($scope, $http) { ...
1
vote
1answer
340 views

Difference between $http.put and $http({method:'PUT'}) in AngularJS

I have to 'PUT' some json data to a server. The below code is throwing an error $rootScope.request.data = {"name": "John", "surname":"Doe"} var uri = //some REST API var action = $http({ method: ...
2
votes
4answers
72 views

Filter $http request data before it is sent

It seems Angular automatically strips properties prefixed with $$, e.g. $$hashKey, from request data / params objects. I would like to exclude my own UI-only properties that I don't want sent to the ...
2
votes
1answer
171 views

Gracefully Handling 401 Not Authorized with Angularjs $http

I am currently working on an problem with a login page for an AngularJS app. The login page uses the $http service to submit the username and password using Basic authentication (Authorization: Basic ...
0
votes
1answer
68 views

Http.post return (error 400)

I try to post object from back_end bad always i have error 400 i don't know if the problem is in front on in back-end: the index.html: <div ng-controller="signupCtrl"> ...
1
vote
2answers
950 views

AngularJS : returning data from service to controller

I am trying to create a service to get json and pass it to me homeCtrl I can get the data but when a pass it to my homeCtrl it always returns undefined. Im stuck. MY SERVICE var myService = ...
0
votes
0answers
34 views

Timing out Angular http.get trouble with $timeout

I am trying to timeout a $http.get that takes too long, but also doesn't error out. Here is what I have so far. $timeout doesn't seem to cancel the $http.get. Any help is appreciated. My $http.get ...
0
votes
1answer
52 views

Angularjs method then of $http request

I tried to use method then of $http because my code after this request is run before the request result is return.So my parameters of response are undefined. var reqgetcustomers = $http({ url: ...
1
vote
3answers
124 views

Angular $scope not available outside my function

Somewhat new to Angular and javascript. I have the following controller written use a factory service to access a local JSON file. Most of this code is derived (or completely taken) from this post ...
1
vote
1answer
764 views

Refused to connect to [Any Url] because it violates the following Content Security Policy directive

I am trying to access data within post method and its name is Login() but when URL is transfer to its location at that time Error is generated. Error:-Refused to connect to ...