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

0
votes
2answers
26 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
58 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
12 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
27 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
45 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
37 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
30 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
51 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. ...
5
votes
2answers
4k views

AngularJS : controller scope won't sync with promise

I've picked up a project and I'm trying to return some data from a service to my controller. I've been at this for about 12 hours, and have tried different methods. They all usually result in this ...
2
votes
1answer
30 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 ...
28
votes
8answers
35k views

The 'Access-Control-Allow-Origin' header contains multiple values

I'm using AngularJS $http on the client side to access an endpoint of a ASP.NET Web API application on the server side. As the client is hosted on a different domain as the server, I need CORS. It ...
1
vote
1answer
45 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
20 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 ...
4
votes
2answers
6k views

What is the equivalent of jQuery ajax beforeSend in Angularjs?

I am familiar with Jquery AJAX call, which has different callbacks like beforeSend, success, complete, etc. This is the example AJAX call with Jquery: $.ajax({ url: 'register.php', type: 'POST', ...
4
votes
1answer
447 views

How to test $http without mock with jasmine and angular-mocks?

I want to make an integration test with real calls to my server, so, I don't want to use the $httpBackend module from angular-mocks, So I try this: ...
6
votes
2answers
7k views

Angular Js - set token on header default

Im trying to add a header with my access token to each API call. It works well for all the GET requests, but as soon as I try to make a POST the header isn't added. Here is how I add the token: ...
28
votes
8answers
71k views

AngularJS not detecting Access-Control-Allow-Origin header?

I am running an angular app on a local virtualhost (http://foo.app:8000). It is making a request to another local VirtualHost (http://bar.app:8000) using $http.post. ...
13
votes
2answers
9k views

Getting AngularJS Error: “[$rootScope:inprog] $digest already in progress” without a manual $apply

Other posts on this error always include someone trying to $apply without using a safe apply, but that's not the case in my example. My function IS successfully returning the data I requested from the ...
20
votes
9answers
10k views

Angular 2: How to use/import the http module?

I've been playing with Angular 2 Quickstart. How can I use/import http module in Angular 2? I've looked at Angular 2 Todo's .js, but it doesn't use the http module. I've added "ngHttp": ...
1
vote
1answer
91 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
62 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
29 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
54 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
26 views

data.data for reading my json

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

Slim Post method not working with AngularJs Http Request

This is my AngularJS controller : app.controller('emailConfirmCtrl', function ($scope, $http) { $scope.check_credentials = function () { var request = $http({ method: 'POST', url: ...
0
votes
2answers
5k views

angularjs: $http basic authentication

I tried angular.js and started with a web-ui for a restful api (using http basic auth). It is really nice and all except the authorization works. Up to now I am using ...
1
vote
2answers
44 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
51 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 ...
2
votes
2answers
25 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 ...
2
votes
1answer
1k views

Sending HTTP Post with multiple data through AngularJS

I am using AngularJS. I would like to send multiple data in a HTTP post through AngularJS. The backend runs Cakephp and I have verified that the Rest API works through python HTTP-post. I have this ...
36
votes
5answers
35k views

Using success/error/finally/catch with Promises in AngularJS

I'm using $http in AngularJs, and I'm not sure on how to use the returned promise and to handle errors. I have this code: $http.get(url) .success(function (data) { // Handle data }) ...
-1
votes
1answer
62 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? ...
3
votes
3answers
340 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
44 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 ...
2
votes
4answers
142 views

AngularJS $http use response in multiple controllers

I have an app where I am loading a bunch of albums in one partial and then when a user clicks on each individual album, they get details for the album like songs, etc. Right now I am pulling the data ...
0
votes
0answers
32 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 : ...
2
votes
5answers
765 views

AngularJS, $http.get() and “controller as”

I'm pretty new to the whole AngularJS world and how it works, however I am struggling to get it working as expected. I know that its something to do with the way I am using $http.get() and trying to ...
0
votes
2answers
75 views

AngularJS : Returning .then() response to controller property

I'm using a factory to retrieve data using $http and the controllerAs capabilities to inject into my view. Without the use of the $scope, I am having issues returning the $http response data into a ...
1
vote
2answers
279 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 = ...
1
vote
0answers
82 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: ...
0
votes
0answers
25 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
22 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
91 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
57 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
255 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: ...
1
vote
1answer
72 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
118 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) { ...
2
votes
4answers
56 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
115 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
49 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"> ...