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
20 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
15 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
44 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
23 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
37 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
48 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
12 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
55 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
45 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
46 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
336 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
34 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
28 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
23 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
430 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
803 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
47 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 ...
83
votes
4answers
181k 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
31 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
606 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
60 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
36 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
66 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
57 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
95 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
43 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
86 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
68 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 ...
72
votes
6answers
78k 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
23 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
66 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
62 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 ...
1
vote
1answer
158 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
307 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
108 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
249 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
42 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
78 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
23 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 ...
6
votes
4answers
7k 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
351 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
135 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
115 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
72 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
37 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
32 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
I ...