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
51 views
Angular $http.get request not running success or error functions
I am trying to make a get request to the nutritionix v1_1 api. When debugging I can see that the function is successfully called and the correct data is passed in. When the function hits the $http....
0
votes
5answers
24 views
@RequestParam and angularjs $http.post data retrieval
I am trying to send an array
arr=["xxx.yyy","zzz.vvv"]
to spring endpoint like this:
$http.post("url",arr)
spring side:
@PostMapping(value = "url")
public Set<String> func(@RequestParam(...
0
votes
2answers
26 views
Angular file upload to PHP backend
I'm developer and I try to learn some of AngularJs, now i try to do a form, and is necessary send a file from input[file] to php, but when I click the buttom the file is not sended to this php, Try ...
0
votes
2answers
27 views
Angular 2 http get not getting
I new to Angular 2 still learning i am trying to hit a url with a get call but the get dosen't seem to go through even in browser's network i cannot find that get url being called.
The program is ...
8
votes
5answers
146 views
All data is gone on page reload. Is there any way to avoid that?
I have developed one dashboard application in angular js which is having search functionality and multiple views with lots of different data coming from that search functionality.
Its single page ...
0
votes
1answer
19 views
Angular - Having troubles receiving $http response from a factory
I have an angular factory doing some $http communication to the server and returning a string. However I get the Cannot read property 'then' of undefined error. I read here and here with similar ...
0
votes
2answers
38 views
Yet Another Asynchronous service returns Undefined
This is my service:
(function () {
'use strict';
angular
.module('app')
.service('ClientsService', Service);
function Service($http) {
function getClients() {
...
0
votes
0answers
13 views
how to get multiple value from angularjs without pojo class in java?
How to get multiple value from angularjs without pojo class in java?
angularjs
<script>
var myApp = angular.module('myApp', []);
myApp.controller("myController", function ($scope, $http) {
...
1
vote
2answers
16 views
Angular http method changing the hour in datetime
I have the weirdest bug ever. I am talking to my API via angularjs and I try to update something by doing the following
console.log('updated: ', event.startsAt);
$http({
method: 'PUT',
...
12
votes
4answers
32k views
How to read response headers in angularjs?
My server returns this kind of header: Content-Range:0-10/0:
I tried to read this header in angular with no luck:
var promise = $http.get(url, {
params: query
}).then(function(response) {
...
10
votes
2answers
6k views
$http response interceptors headers
I'm sending a custom header from server in a response. In $http response interceptor I want to get this header, but the only header I could get is Content-type header. How can I resolve my problem?
...
0
votes
3answers
67 views
Cancelling an angular service promise
I have a controller that performs a http request.
This request can take anywhere between 2 seconds to 4 minutes to return some data .
I have added a button, that users should click to cancel the ...
2
votes
1answer
54 views
Get request is not fulfilling Angular-Express
I'm new to MEAN stack I want to have data fetch from express server (which I created with mongodb) when I click button, the function on button click was executed but request was not fulfilled, the ...
0
votes
4answers
54 views
how to call http call inside the for loop after success of before http call?
I want to call the api after completing the first is success.But in my code it call the api before the first one was completed
for(var w=0;w<Ids.length;w++){
$scope.msgObject = {
...
132
votes
6answers
61k views
How to cancel an $http request in AngularJS?
Given a Ajax request in AngularJS
$http.get("/backend/").success(callback);
what is the most effective way to cancel that request if another request is launched (same backend, different parameters ...
0
votes
1answer
41 views
Can not add bearer token in $resource header
I am not able to add bearer token in $resource service header for token based authentication. I used following code
Factory
return $resource(appSettings.serverPath + "/api/product/:id", null, {
...
1
vote
1answer
41 views
Promise.all processes the promises in a group of 6 at each time [duplicate]
I wanna make a bunch of (let's say 20) HTTP POST requests (in order to send information of an app to some HTTP servers) simultaneously.
I am using http angular service to return a promise:
function ...
1
vote
0answers
21 views
laravel response status -1 on mobile
I'm developing an applicaiton using laravel 5.2, and using angular in some places on the front end. I'm always getting -1 as the response status for $http requests, when testing with mobile. The same ...
0
votes
2answers
258 views
switching between api and flat json in angularjs
I think my stackoverflow search-fu is broken today, because it can't be that I'm the only one who's ever asked this. Cripes, I hope not, because I could really use some help figuring this out. ...
1
vote
1answer
52 views
Angular 2 Http RetryWhen
I'm trying to use retryWhen in HTTP calls.
It works perfectly when try to use like this:
return this.http.get(`${environment.apiUrl}/track/${this.user.instance._id}/${this.currentPlayer.playlist.id}/...
14
votes
2answers
2k views
How to read JSON error response from $http if responseType is arraybuffer
I load some binary data using
$http.post(url, data, { responseType: "arraybuffer" }).success(
function (data) { /* */ });
In case of an error, the server responds with an error JSON ...
0
votes
1answer
36 views
Why Sending Params in Post Works like GET
I am Trying to make an http post request to .php file at the server all what i do is making the request like this
$http({
url: 'http://localhost/sebha/login.php',
method: '...
-1
votes
1answer
38 views
Angular 2 services subscribed twice [duplicate]
I just start first project with Angular 2 and I've trouble with services.
I've an http service called when submitting a form, but when I submit the form, the http request is executed twice.
login....
0
votes
1answer
18 views
Can't post data from Angular to my nodejs api
When I try to post data from angular to my nodejs backend it doesn't work.
[Backend] This is the function that catches the posted data. I tested it with postman and it worked. The console.log is just ...
0
votes
1answer
83 views
Angular 2 Spring Boot Login CORS Problems
I am trying to develop an application with Spring Boot for the back end and Angular 2 for the front end.
Actually i have connection problems, when i accessing on the mvc login page from spring.
I ...
11
votes
2answers
4k views
Reject from 'response' into 'responseError'
Sometimes, the API I'm using will return 200 ok even though there has been an error. The response JSON object will look something like:
{
error: true
}
I've built a $http response interceptor ...
3
votes
2answers
68 views
Accessing custom http response headers in angularjs
I am trying to access the header 'error-detail' as you can see in the browser network inspector (link above), the header gets returned. Server-wise I have also added the custom header to the 'Access-...
1
vote
1answer
57 views
How to use post method in AngularJS
I am fairly new to the Angular world, and i got some issues on using http post method. Please help me with this, thank you!
To make my code look easier, I cut out the irrelevant stuff.
Background: I ...
0
votes
2answers
53 views
Property 'update' does not exist on type 'Http'
I used Angular 2 Release and using Http from @angular/http.
When I call the method update, generate this error:
"Property 'update' does not exist on type 'Http'".
On method Get and Post, Work ...
212
votes
11answers
209k views
Processing $http response in service
I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model ...
0
votes
1answer
74 views
Angular 2 observable-subscribe showing undefined
I am having the same challenge as was faces in the SO Post here I am getting undefined in the subscribe method in my component.ts, even though in my service i have the data.
See codes below
p....
5
votes
3answers
225 views
What is the HTTP promise object in AngularJS?
Although I am working with the HTTP promise object in AngularJS, I don't have a clear concept of what an HTTP promise object actually is and what the is difference between an HTTP promise object and a ...
1
vote
2answers
39 views
Angular JS $http promise object — How does it work?
All,
I'm a beginner to Angular framework and have been reading $http service. I thought I understood Promise object in Angular JS until the below questions popped up my mind. Can you please help me ...
2
votes
1answer
4k views
Angular 2 Http – How to Get JSON Data from API with finance_charts_json_callback() callback
I'm trying to get json data from this api: http://chartapi.finance.yahoo.com/instrument/1.0/NFLX/chartdata;type=quote;range=1d/json
And I don't know how to get into the returned ...
1
vote
2answers
43 views
How to serialize GET params with Nested Objects
I need to send in the following get request via Angular. Upon this request I have a rails server that takes in the param and returns JSON data.
GET request needed:
http://localhost:8080/clients....
0
votes
1answer
78 views
Angular 2 Webworkers Http Uncaught (in promise): not implemented
I've been stuck on an error that I'm not completely sure how to solve.
My application is made in Angular2 and runs completely in a webworker largely based on this tutorial http://www.syntaxsuccess.com/...
1
vote
1answer
36 views
MVC model binding complex type that has a property of complex type collection with Angular JS
I am developing an Web application using Angular JS and ASP.NET MVC. But I am having a problem with model binding complex type. Please let me explain what I am doing first. I am uploading list of ...
0
votes
4answers
38 views
how to send data with ever $http post
I wanted to be able to send ipAddress for every $http.post() that's being sent to backend without manually mentioning it every time i send a post. How to do it in angular ? I found out there was $ajax....
47
votes
4answers
104k views
Angularjs autocomplete from $http
I'm trying to write an autocomplete directive that fetches data from the server using an $http request (without using any external plugins or scripts). Currently it works only with static data. Now, I ...
0
votes
1answer
197 views
Angular $http request timeout not caught in error function on iOS 10 cordova
This is happening on Safari iOS 10 Cordova:6.3.1
Request using Angular $http, error function not called
$http.get("http://10.255.255.1").then(function(res){
console.log("res: " + res);
},function(...
0
votes
1answer
100 views
Angularjs - cannot pass data from factory to controller
I'm new to angular and find myself stuck. I am trying to pass data from a factory to a controller and it returns undefined no matter what I have tried. Can anyone help? Ultimately I will need to ...
0
votes
2answers
44 views
Angular 2 - http get return wrong object
I'm using @angular/http get to fetch data from server, here is my code :
private _currentPT: any;
public phongtroDetailChange = new Subject();
layPhongtro(id: number): Promise<any> {
return ...
8
votes
1answer
19k views
Angular 2 http request with Access-Control-Allow-Origin set to *
I'm using angular2 and typescript.
I'm trying to post to my mail chimp subscription list.
My code so far:
constructor(router: Router, http: Http){
this.router = router;
this.http = ...
7
votes
4answers
525 views
progress bar on web request ($http) AngularJS
I'm new in AngularJS. I'm trying to make a request to a web service. I would like to implement a progress bar that tells me what percentage this request. Maybe someone has a basic example of which can ...
0
votes
2answers
74 views
Post And send object to MVC Web Api using Angular 2
I want to post data to my MMVC web api by using angular 2. But i don't know how to pass a object to my MVC API using angular. Any Help will be grateful.
My Service Code in Angular 2
@Injectable()
...
0
votes
1answer
66 views
How to Handle multiple Ajax call calling same function?
Hi have 4 directives on the page, all directive require list of user.
User List is stored in database which require hhtp request.
As 4 directive are on the page at same time so 4 different ajax call ...
0
votes
2answers
410 views
call function A in function A after success call function B in angular js
I am using some functions that send $http async request to server side.i want to call same current function after relogin user if response is "notlogin". I think i need to use promise but how?
$...
1
vote
2answers
26 views
Best separation of concerns approach for $http tasks between a controller and service
(working with Angular 1.5)
Read many articles (some recent, some old / outdated) on the subject of $http requests, promises, and separation of concerns, and am currently experimenting with the ...
1
vote
0answers
69 views
Using Elasticsearch Scroll API with AngularJs
My Angular (v1.2.15) application needs to process a large (60k entries) index in Elasticsearch (v2.4). The index is too large to use traditional paging using from and size parameters in the ...
0
votes
1answer
41 views
AngularJS - resolve $http instead injecting value
I have a small tool, using AngularJS with the .value() recipe, which currently dumps almost the entire DB as JSON into this value. So I want to optimise the pages by loading some of this information ...