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
3answers
19 views

How to encode URL in angularJS

I'm trying to get the data from my Rest API controller using anuglarjs http GET request. However, the params that I need to send include "." symbol which caused the URL failed. I tried to encode it ...
0
votes
4answers
17 views

Persisting Scope beyond get request in Angular

I have the following code: $http({ method: 'GET', url: 'http://localhost:8080/getStuff' }).then(function successCallback(response) { $scope.stuffData= response.data.length; }, ...
0
votes
2answers
56 views

How to download a zip file in AngularJS / FilesaverJS

i have a service function which return me 3 result files(2 text files, 1 zip file). i want to check the header of the response to see if the file is a zip or a text to set the right configuration to ...
0
votes
2answers
68 views

Getting PHP AJAX response data with Angular $http Service

I'm sorry if this is repeating previous questions, but i haven't been able to find a solution which seems to work with my problem & im new to Angular. I have an Angular form, which communicates ...
0
votes
1answer
35 views

Angularjs inconsistent delays between $http.get and $http.post

Here is a part of the code of one of my controllers. //service call to add record to database //bookApi has addBook method which contains a $http.post inside bookApi.addBook(book); //service call ...
0
votes
1answer
44 views

Angular / Controller loading a json file fails with an exception I can not understand

sorry, maybe a stupid problem, but I am still a newbie with angular. The code: -- EDIT #2 -- ----- ----- ----- ----- ----- ----- ----- MyApp.controller('DataController', ['$http', function ($...
0
votes
2answers
39 views

How to upload files to AWS-S3 with Angular $http PUT

In my Angular application I try to upload a file to AWS-S3 with $http.put(url, file). However it's not working, I get back a HTTP-403 Forbidden telling me that the signature s3 calculated differs ...
0
votes
0answers
27 views

AngularJS Display JSON data in view [duplicate]

In my module I have a service that calls $http and gets an Array of objects, function MenuSearchService($http){ this.getMatchedMenuItems=function(searchItem){ var ...
1
vote
2answers
28 views

angularjs change rootscope after promise in a controller

I'm trying to change some $rootscope variables from within a controller after a I have received a promise from a service. The $rootscope variables are used to set the html page title attribute etc. ...
1
vote
2answers
24 views

$http GET method Displays Blank Page

I tried to parse json using below code but it is displaying a blank page. var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { $http.get("http:krispypapad....
1
vote
5answers
52 views

Chaining multiple $http.get() ng-init angularjs

Im working on a scenario where on page load i have 2 $http.get() request. One $http.get() are independent on another $http.get(). Every thing works fine.But in some situation my 2nd $http.get() ...
7
votes
4answers
3k views

Error with $http.get in angularJS — Success not a Function

Getting this error: angular.min.js:122 TypeError: $http.get(...).success is not a function at getUserInfo (app.js:7) at new (app.js:12) at Object.invoke (angular.min.js:43) ...
9
votes
2answers
3k views

Why are angular $http success/error methods deprecated? Removed from v1.6?

The angular documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library?
3
votes
3answers
59 views

angular component one-time binding from $http shows undefined

I'm new to Angular. I'm trying to use components (1.6). In the parent, I have an $http.get that gets data from a service and then assigns the response to a $scope variable. That scope variable is ...
0
votes
3answers
41 views

Getting json url links (Youtube) to show using angularjs

I'm trying to use AngularJS to get data from a json file which has video objects. However, I can only figure out based on other resources/references how to take ONE specific url and concatenate it ...
40
votes
9answers
124k 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. $http.post('http://bar.app:8000/...
-1
votes
2answers
38 views

AngularJS - Make synchronous http request

Angular Service this.sendCommand = function (someData) { URL = myURL; return $http({ method: 'POST', url: URL, ...
0
votes
1answer
33 views

Managing data from http method in controller with AngularJS 1.5 components

Ng-repeat in component can't show data charged from $http.then in controller. What am i doing wrong? Service calling rest method in app.js: app.service('dataService', dataService); function ...
2
votes
4answers
3k views

Building OData $filter URLs with an Angular provider

I have an angular provider for querying an OData service. Now I'm trying to build a $filter function onto that provider, so I can use it throughout my app. The problem I'm running into, and so far ...
1
vote
3answers
35 views

Can't assign object returned by service to $scope

I'm trying to assign data returned by service to $scope property. Somehow it doesn't work properly. The service method correctly get data via $http.get but then it is not assigned to $scope in the ...
0
votes
1answer
22 views

View No Longer Updating Immediately in Efforts to Clean Up Scope Soup

I've fallen victim to self-imposed $scope soup and am taking steps to correct this. I'm adopting some of the methods written about by Josh Carroll in his article here: http://www.technofattie.com/2014/...
1
vote
1answer
22 views

Same data is returned in AngularJS Promise Chaining

I want to make 3 API calls when my page is loaded to bring the necessary data. My application is in AngularJS#1.5.8. I am able to bring the data separately in service, but for some reason, in the ...
2
votes
1answer
66 views

AngularJS - Toaster not working in Controller

Service.js this.userLogin = function (username, password) { var dataBody = $.param({'username': username,'password': password}); return $http({ method: 'POST', ...
1
vote
1answer
32 views

Add document access denied

We've created an AngularJS 1 project and we can successfully use the search functionality using a POST. We added a controller for adding documents to an index but we keep getting the message ...
0
votes
1answer
49 views

How to login on a Domino server with angularjs?

I'd like to login to a Domino server from an angularjs webpage. The page itself resides in the database I want to authenticate with, so it's not really remote. This is my code: return $http({ ...
1
vote
0answers
257 views

Angularjs showing 500 internal server error on posting data to laravel routes

For some reason I'm getting a 500 interval server error when posting data from angular to laravel route. app.js var quora = angular.module("quora-app", ['q-controller-1', 'ngRoute', function($...
0
votes
1answer
13 views

using factory in the controller retrun undefind

i am trying to send value from my view to the controller using function inside ng-click , then use that value to pass it to my factory which goint to pull data from rest api link , but the value im ...
0
votes
0answers
82 views

Internal Server error 500 in Angular + Laravel

I am developing a application using laravel and angular js. Laravel is for the api and the view is also in a blade template which includes a ng-view element. I get this "internal server error 500" ...
-1
votes
1answer
68 views

How to check user token in Angular?

I generated token with JWT using node and angular, and can't check if user is authorized. Node: module.exports.authenticate = function(req, res) { var user = new User(req.body); User.findOne(...
1
vote
3answers
47 views

How to filter in ngTables

I am using ng-table to generate my table. but my data has two column, the first one is an object. My function in controller : $scope.allServers = function() { $http.get("/volazi/getServers")....
3
votes
1answer
347 views

Post Request going to Pending state

I am using AngularJS and calling a REST using http. Below is my AJAX code, but all of my request are going to pending status in browser. I have searched this issue on internet and tried a lot of ...
0
votes
0answers
50 views

AngularJS : Showing a spinner while during $http request

I put in place some routes with the $routeProvider. The place is that some templates need some time to load because of the $http requests. What I wanted to do is to display a spinner or a wait ...
0
votes
1answer
46 views

Angular JS $http POST not responding on success in ASP.NET MVC

I am developing an ASP.NET MVC Application. I am using Angular JS. Now what I am doing is posting data to server and getting json result from the server. But my problem now is, it sends data to server,...
0
votes
1answer
44 views

Submitting ASP.NET MVC CSRF token with $http in Angular JS

I am developing an ASP.NET MVC Web Application. I am using Angular JS. But I am having a problem with submitting post form to server because of CSRF validation. First of all, I am new to Angular JS. ...
2
votes
3answers
584 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: function(...
5
votes
1answer
817 views

Authenticating angular for HTTP requests on MVC4 site using Windows Authentication

I am currently developing a website using AngularJS, and the application is meant to POST and GET data to and from an already running MVC4 application. This MVC4 application is using Windows ...
10
votes
5answers
10k views

How to mock an angular $http call and return a promise object that behaves like $http

Is there a way to return an HttpPromise (or something similar) to mimic a call to $http? I want to set a global variable that indicates whether the real HTTP request is made or whether a fake ...
0
votes
0answers
52 views

Error while sending JSON in DELETE ajax request in angular js although it works fine in chrome postman

Iam trying to send JSON in DELETE ajax request in angular js. It gives 500 Internal server error although it works fine in postman. Postman Snapshot My code var data = $scope.removeTaskList; var ...
91
votes
4answers
198k views

How to enable CORS in AngularJs

I have created a demo using JavaScript for Flickr photo search API. Now I am converting it to the AngularJs. I have searched on internet and found below configuration. Configuration: myApp.config(...
5
votes
1answer
32 views

Encapsulating model in its own class for Angularjs app

I have 2 views. One is to list student in a table and the other is when you click on a student, it shows the details of the student. I have brought the student to it's own class in a separate file ...
2
votes
1answer
854 views

Referencing multiple API calls in one Service (Angular)

I am accessing an API via Angular $http requests to gather information for different football teams. If I were to be only accessing one team, this would be fine - I would create a Service that made ...
1
vote
2answers
76 views

Angular $http service wait until data returned

I created this http service: (function () { "use strict"; angular.module("inspectionReview").factory("inspectionReviewServices", ["$http", "config", inspectionReviewServices]); function ...
0
votes
3answers
39 views

Able to access object returned by service, but accessing its properties gives undefined

I'm an angular beginner and I'm trying to set up a factory that gets data from my php back-end and updates the controller. Here is my basic code: factory app.factory('sessionStatus', ['$http', ...
1
vote
2answers
106 views

Angular: $http requests gives -1 status

A node.js server gives "This is a string". (writeHeader, write( string), end). When performing a $http request, I see that the node.js server is responding and sending the information back. In ...
1
vote
1answer
65 views

$http timing issues, AngularJS

Have two issues. I am trying to get a value from an $http response and populate a variable with it that should then update a couple DOM objects. Problem is that it seems to be having a timing issue ...
4
votes
4answers
2k views

$http issue - Values can't be returned before a promise is resolved in md-autocomplete Angular Material

I'm using Angular Material md-autocomplete in my project. In that I'm getting the suggest listing from the Service Host via ajax call using $http service. Issue: $http issue - Values can't be ...
0
votes
3answers
127 views

angularjs multiple controllers same $http request cache

Working on a application that requires multiple components to be displayed on the same page that need data from the same api url. As per example I have two components, one is a breadcrumb one is the ...
2
votes
1answer
57 views

Angular post, put, delete returns 405

I am new to angular. I cant invoke POST, PUT and DELETE methods using angular (GETs working fine) I have a .NET WebApi server which all methods and all resources URLs works and tested using Advanced ...
0
votes
0answers
96 views

AngularJS JSONP yields “Cannot read property 'appendChild' of null” error

I have added a controller to my <body> with a JSONP request made immediately in the controller, (example code) app .controller("controller", function(makeRequest){ makeRequest(); ...
2
votes
4answers
83 views

HTTP POST turns into OPTIONS AngularJS

I'm trying to submit a login form to a rest Api, translating my Jquery/Javascript code into AngularJS. I try to use $http service for send the request, but when I submit the form, the POST request ...