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.
0
votes
1answer
18 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
11 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
1answer
316 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 ...
2
votes
3answers
334 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
793 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
9k 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
43 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 ...
79
votes
4answers
168k 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
30 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
422 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
57 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
32 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', ...
0
votes
2answers
48 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
51 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
1k 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
66 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
41 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
79 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
61 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 ...
68
votes
6answers
72k 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
...
0
votes
0answers
22 views
Defining optional parameters in AngularJs http get
I have this code for HTTP get Method. I'm using currency as a parameter that is required but I would like to add optional parameters for time and date wich are also included in the API. How do I do ...
0
votes
4answers
57 views
AngularJS, how do I use a service to capture HTTP data and bind it to my controller?
I have an API call that's working great, but I'd like to use it on several controllers so I moved it to it's own service. I'm running into what looks like a classic Scope issue or a misunderstanding ...
2
votes
1answer
52 views
$state.go not working in single controller
everyone. I am having a strange problem...I have several states in my app, and they all seem to work except inside of one controller. I have posted the factory whose function I am trying to use, along ...
0
votes
1answer
103 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 ...
6
votes
3answers
191 views
Why do we prefer using $q in angular instead of $http
I am currently using $q service from angular to make API calls like this:
var deferred = $q.defer();
$http.get(config.apiHost + details.url)
.success(function (data) {
deferred.resolve(...
1
vote
1answer
92 views
AngularJS 1.5 Components printed before gets the controller values
I've a parent view with a parent controller, with 2 children component, each one with his own controller.
Something like this
<section> // Main Controller
<table-users listusers="...
1
vote
4answers
158 views
Cannot POST data to server through angularjs's $http module
I am coding using angular ajax. The client side code is:
$http({
method: 'POST',
url: '----/test.php',
data: ({'txtDeviceID': 12345678}),
headers: {
'Content-type': '...
0
votes
0answers
33 views
C Program Web API call from AngularJS $http
How I can give call to C Program Web API from AngularJS $http request?
AngularJS $http part has been already done. But I m new to C Program.
I want to know: How my $http URI and C program Web API ...
0
votes
1answer
63 views
node uploading file $http.post from angularjs has undefined req.body
I'm building a file upload functionality with my angularjs app that would upload a file to my node api that will ftp to a cdn server. Right now I'm stuck with just getting hte file. I tried using ...
0
votes
2answers
22 views
How to communicate AngularJS's $http routes and APIs developed in C Programming
I have made web application GUI using AngularJS, Bootstrap, HTML, CSS.
Backend team are developing APIs in C Programing.
So how my routes in $http request (sending from factory) will communicate to C ...
5
votes
4answers
5k 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
3answers
239 views
How to skip angularjs interceptor for an HTTP request?
I have an angularjs app, in which I have an interceptor that adds the authorization token to the header of each request.
However, somewhere in the application I need to use and external API where ...
0
votes
2answers
1k views
how to prevent duplicated $http requests in AngularJS app?
I need to prevent sending the same request repeatedly to API before the previous request will give the response. I have found out some solutions. But, I don't want to disable the button while waiting ...
1
vote
3answers
88 views
How to assign value returned by service's $http.get() to a variable in controller?
I have created the separate service for fetching data from server, but I want to assign the data that this service returns to variable in the controllers. in this case data is a simple JSON file.
...
-1
votes
1answer
71 views
Angularjs $http post promise [duplicate]
I try to use the promise respond from a $http.post, to get back the new ID of the record as integer and use it for the next $http.post. I used How do I return the response from an asynchronous call? ...
0
votes
0answers
29 views
Angularjs use $http post promise [duplicate]
I try to use the promise respond from a $http.post, to get back the new ID of the record as integer and use it for the next $http.post. My first code:
var streckenId;
var trackpunktId;
var ...
1
vote
4answers
56 views
Angular async service
I'm trying to do an ajax call via $http service inside a custom service. Then I want to customize, inside my controller, the data received in the custom service.
I wrap the customizing data function ...
0
votes
1answer
35 views
AngularJS add data array to $http request
I'm going to add some data in an array to $http service in angularjs. The way I add them to service is mentioned below (and it works properly)
var inputValueArray = new Array($scope.formdata);
I ...
0
votes
0answers
29 views
Unable to download JSON from CROS Domain request
I wanted to download json from below url
http://www2.rsphinx.com/static/misc/cric_scores.json
Server allowed cross domain requests also.
But every time i am getting error of cross domain request
...
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
2answers
36 views
Why this angular $http.put parameter won't get passed?
I am facing a very weird case in my angularjs app. In a factory, the following code works properly:
$http.put(apiBase + 'delete?id='+orderId);
Which obviously connects to an api to perform a PUT ...
1
vote
1answer
129 views
Angularjs: Making another $http request inside a $http interceptor
I have a simple (half finished) http interceptor that appends a Bearer token (stored in $window.sessionsStorage) to the header so that REST API requests can be authenticated:
function ...
0
votes
3answers
223 views
In AngularJS, my directive can't access $scope properties of the parent controler defined in $http
I'm creating a custom directive that inherits the scope of the parent controller. For the most part, I can access the directive's "scope" object that I set in the controller's "$scope" except for ...
1
vote
1answer
150 views
AngularJS ng-init does not work
When i go to list.html right after loading the page it doesnt show me the list. I need to go to form.html first and then back to list.html and then it gives me the list. When i had $http functions in ...
0
votes
2answers
53 views
Angular.js - $http.get - use cache from file
Is it possible to use a file (.js / .json) the angular.js cache for $http.get?
We have an angular application, and we want to download some pages and view them offline.
So, the idea is, before ...
1
vote
0answers
88 views
How to request a JSON with ajax on AngularJS?
How request a JSON with ajax on AngularJS?
I have written my site on django.
On get request to 0.0.0.0:8000/json/ ,it sends back a json.object
At django, part views.py:
def send_json(request, param)...
0
votes
0answers
49 views
Woocomerce API + Angularjs with Tokens
I am trying to connect to woocommerce api & angularjs, I already created the token through the woocommerce settings, and use angular http.get. In the past i tried to send tokens through a header ...
-1
votes
2answers
1k views
POST 404 Not found.. Angular js
here i'm sending data through $http.post to data/user.php
app.factory('loginService',function($http){
return{
login:function(data,scope){
var $promise=$http.post('data/user....
0
votes
2answers
78 views
In AngularJS, $http doesn't change my select option tag data
I have an issue in AngularJS on using $http to fetch data from server.
Here is my HTML
<select ng-model="foo" ng-options="item as item.name for item in items"></select>
Here is my ...
1
vote
1answer
36 views
Custom infinite scrolling trigger many times
I am new to angular was used to work with jquery.
I set a directive which listen scrolling to trigger an http.get request when the user is almost on the bottom of the document. Everything works fine ...