426 questions
0
votes
0
answers
74
views
Make angularjs $digest run after returned Bluebird wrapping angularjs $http service
So I have some code in a service that looks like this:
getData(params) {
// ... config, url
return this.$http.get(url, config)
.then(result => {...})
.catch((e) => {...})...
1
vote
2
answers
105
views
Can not get data from service using angular 1.6 with TypeScript
I have a problem with accessing data from Service in Controller.
Here`s my Service's file code:
import {IHttpService} from 'Angular';
export class MyService {
public static $inject = ['$http'];
...
0
votes
0
answers
94
views
Ajax request fail over https on iOS browser but not through http
Hi thanks in advance for the help.
We're running a mobile web app that has been working fine on all browsers when it originally went live earlier this year.
About the app:
Running on IIS 8.5.
...
0
votes
2
answers
210
views
Data from database is not loaded to a variable on page load using angular
On page load, I get data from a database and place it in $scope.x. In my network tab, I get the list from my database but it is not loaded to the variable which I will soon be needing in a dropdown ...
2
votes
1
answer
6k
views
calling Https url on Http get request angularjs
I have a Https url and want to send request to get data from that URL , scenario 1:
from my browser If I hit the Url i get the response whereas from my Angularjs App I get always an error 401 , but ...
1
vote
1
answer
2k
views
Http service catch error angular js
I have created a service that deal with get and post request in angularJS but the problem is in my controller I couldn't catch the error call back however success callback is working good:
app.js
...
0
votes
1
answer
145
views
Limiting database output in AngularJS when using $http and get()
I get data from the database using the $http service and get() method. The database contains 100 records in the form of an array of objects, but I only need to get the first 10 records, not all 100.
...
0
votes
1
answer
3k
views
returning image/jpeg as arraybuffer or blob
I am currently making a call to my api which returns an image as an image/jpeg. My issue is the when calling the url through javascript angular .factory resource I am getting my array buffer as empty {...
0
votes
2
answers
88
views
$http Service Not Updating View
I have two controllers one nested inside another. ParentController has one object which I am using in ChildController as it is directly available in child. Now, in child, I am calling $http service ...
3
votes
1
answer
1k
views
How to get $http readyState on AngularJS?
How can I get $http readyState, use like this:
var request, interval;
request = $http
.post('/user/info', {...})
.success(...);
interval = setInterval(function(){
if(request.readyState < 3)...
2
votes
1
answer
7k
views
How to do XMLHttpRequest (AJAX) with AngularJS
I'm trying to use AngularJS within an POST request, but I cannot use $scope within the event.
Thats my code (for demonstration purpose I just add status within the Angular construct):
myApp....
1
vote
2
answers
764
views
How to efficiently poll mySQL database with $http.get
** ANGULAR 1.X **
Hello everyone! I need help with making this $http.get function asynchronous, as you can see from the code, my current temp solution is to setInterval the displayData scope. Which ...
-1
votes
1
answer
2k
views
AngularJS HTTP request error handling
I've seen different examples of Restful API facotires error handling and this is a bit confusing. Here is two examples:
A
angular.module('app').controller('userCtrl', function($scope, User) {
$...
0
votes
0
answers
98
views
How to pass multiple variables from Angular JS using $http to PHP - ERROR [$http:baddata]
I am using angular js and angular js ui-route. I am trying to pass a registration POST form variables from a view passed to angular and send to PHP using $http.POST.
Here is my index.html
&...
1
vote
0
answers
59
views
`$location` causes page to hang after redirect with `$http` Interceptor?
Can anyone help me understand why my authInterceptor, upon a 401 or 500 error, redirects OK (using $location) but the page seems to hang aftewards, and the response does not seem completed? Does ...
0
votes
0
answers
155
views
Difference between AngularJS standard $http and NgResource
Who can tell me at least 5 differences AngularJS standard $http and NgResource?
Expect that NgResourse is better for RESTfull Api.I searched for this but didn't find a good answer:(
0
votes
1
answer
1k
views
NodeJS and AngularJS: Download file $http.get() and save to folder
I'm developing an Electron app using NodeJS and AngularJS to download mp3 files from a web service and save them to a specific folder.
To accomplish this, i'm using AngularJS $http.get() to download ...
0
votes
1
answer
1k
views
method not allowed 405 when trying to call from angular httpclient to asp.net web api
I am trying to create a call from my Angular 4 application to my server that is asp.net web api, first of all I enabled cors in my server and it seems working, now when I am trying to call I am ...
0
votes
1
answer
1k
views
Get URL from a file upload post
I'm uploading some elements to S3. I'm using the same example inside of this link:
JsFiddle
myApp.controller('myCtrl', ['$scope', 'fileUpload', function($scope, fileUpload){
$scope.uploadFile = ...
0
votes
1
answer
541
views
Loading of paginated data from API
I am working on a system that currently requires me to load all items from an API.
The API is built with pagination feature in it. I keep calling the API a number of times and $http.get cursing the ...
0
votes
0
answers
226
views
Is cancelling AngularJS $http timeout necessary?
I'm trying to improve my app performance on mobile devices with laggy networks.
The first step was add "global" timeout for all http request, I used simple request interceptor for that - request(...
5
votes
3
answers
5k
views
Is there an any method ordering when $q.all has multiple http call functions in Angularjs?
First of all, I am not good at angularjs.
While I've been studying about $q, I faced a weird problem.
When I use $q.all, I put $http in regular sequence expecting to get results in same order,
but ...
0
votes
0
answers
70
views
AngularJS $http service has CORS issue. But it should be working for JSONP, right? [duplicate]
I checked the mentioned post, first it has nothing to do with AngularJS, second, the answer to that post is: And NO, you can't use JSONP for fetching html data.
How come my post is a duplicate, than ...
0
votes
2
answers
1k
views
Handle Status 304 response with AngularJS $http
If i have one API server then the API is send ajax data with JSON format :
{"status":304,"message":"Cannot delete data where PK is empty or > 1"}
how to AngularJS $http post call the status and ...
1
vote
1
answer
1k
views
Angularjs - Cannot read property 'then' of undefined [duplicate]
I'm new to angularjs, and I know there are a lot of questions regarding this error,
Unfortunately I couldn't find an answer that fits my problem in any of them.
I've got a factory that holds all the ...
3
votes
1
answer
346
views
Error status 415 when uploading Files to SpringMVC using Angularjs
How to upload Files along with Form Data using Angularjs?
I am working on a UI that is built in AngularJs. It has a form where users put their details like Id, Name, Address, PIN etc. Along with that ...
5
votes
2
answers
3k
views
Replacing $http with Fetch API
I'm replacing $http with Fetch API and got replaced $q with Promise API. Because of that, Angular didn't run digest cycles anymore, thus UI didn't render. To solve this problem I tried Zone.js and ...
1
vote
2
answers
1k
views
block consecutive $http request
I am working in an angular project there I have a grid with some data and some actions.
On clicking one of the action in onclick function an ajax request is going the server side which is once in a ...
1
vote
2
answers
154
views
Angularjs - Loading $http response item Less than 5 at a time
I'm working on a product catalog application using Ionic Framework, with php to retrieve product from database and ajax to load it in frontend, every thing is working great, but when i try to filter ...
1
vote
2
answers
1k
views
Undefined $http data when resolved with `.then` method
I used the console log which returned the array of data fetched from the server, but when I call the scope on the html I get an undefined error on the console.
app.service('blogpostservice', ['$http',...
0
votes
2
answers
1k
views
Uploading file to openstack object storage from JavaScript
I have a openstack object storage container to which I'm trying to upload files directly from browser.
As per the documentation here, I can upload the file using a PUT request and I'm doing this ...
0
votes
2
answers
182
views
Unable to fetch json data using angular factory service [duplicate]
I am unable to fetch my json data using angular factory service.
I seem to load the files correctly, no error on developer tools console, still the data is undefined on the request - means empty.
...
0
votes
1
answer
1k
views
sending API key in the request headers with angularJS 1.6.3
I want to send an api key for every request I make:
function MyService($http) {
var req = {
method: 'GET',
url: 'https://api.giphy.com/v1/stickers/trending',
headers: {
...
1
vote
0
answers
67
views
Can't get custom header with $http [duplicate]
I'm trying to get the header with $http, I send a response with the data and header with Node.js, x-auth is my custom header.
I can get the response.data just fine,
but when I use response.header('x-...
0
votes
1
answer
92
views
$http get shortcut messing up program in AngularJS?
In the script below, I have posted a boiled down version of my code. It's essentially a simplified search engine.
The script loops through the $scope.list_of_fruit array, and filters it according to ...
0
votes
0
answers
65
views
$http.post setting requestHeader
How does:
xmlhttp.open("POST", "Service.asmx/GetChemicals", true);
xmlhttp.setRequestHeader("content-type", "application/json");
Translate to the angular controller? Right now I am doing:
var p = $...
0
votes
2
answers
2k
views
$http POST not returning correct response
The issue I'm having is that $http POST is not returning the correct response.
The data I require is stored under config instead of data
The Http POST request:
for (var i = 0; i < filmService....
4
votes
4
answers
487
views
Return function value from $http GET service
I am trying to return an array from a function once onClick is triggered. I see the values contained in the array in the console. But I don't see the values displayed on the HTML page.
The Controller:...
0
votes
2
answers
63
views
Javascript $http dependency injection
I'm having some problems trying to make http calls inside the same javascript controller which it gives me the error: 'function is not defined'
If I move the function to the outside of controller, i ...
1
vote
2
answers
201
views
AngularJS $http.get request not displaying data in Ionic
I am new to AngularJS, and after using the commands as shown in several youtube tutorials and reading the documentation, I cannot seem to get the data displayed on an API, using $http.get() request.
...
1
vote
0
answers
2k
views
AngularJS get request always send undefined Bearer token
My get request with authorization header :
return $http.get(serviceBase + 'api/values', {
headers: {
'Authorization': 'Bearer ' + authService.authentication.token
}
...
1
vote
1
answer
705
views
How to populate md-autocomplete dropdown list?
I'm trying use md-autocomplete with $http(), I can see the values in the console, but I can't display the data returned from the api request to the autocomplete.
I tried using the return keyword to ...
0
votes
1
answer
105
views
Retrieving data out of post success from separate controller angularjs
I am writing a simple service that uploads a file and posts it to a Spring controller. The controller manipulates this data and returns several objects as JSON.
I am working with the following Angular ...
1
vote
2
answers
334
views
Sending variable by http get
I have problem with sending variable by http.get, can someone correct me?
$http.get("/product/products", { 'quantity': 5 }).then(function (resp) {
$scope.products = resp.data;
})
Thanks much
0
votes
1
answer
108
views
AngularJS - $http call inside factory to be returned in controller $scope
I think the title pretty sums up what I want to achieve. I looked in different SO threads regarding the issue, some uses $q while others do not.
So I tried to pull something simple:
.factory('db',['$...
0
votes
1
answer
917
views
How to POST object + array to WebApi .NET/C# controller using AngularJS $http?
My C# model:
public class MyModel
{
public string MyString { get; set; }
public int MyInt { get; set; }
public List<MyList> MyList { get; set; }
}
public class MyList
{
public ...
1
vote
1
answer
4k
views
Angularjs 4 HTTP Get request to json file
I have the folowing problem, i cant load the data from json.
What I'm trying to do is access the given file address and spell the data but something does not load I tried and without async
driver-...
1
vote
0
answers
46
views
Should express router.get intervene page loading?
I have built a mean-stack application. I use http to communicate data between front-end and back-end. For example,
In front-end, I have
app.factory('ops', ['$http', function ($http) {
var o = {};...
0
votes
2
answers
813
views
chaining http.get promises with angular service
Is this a bad way to do this? I'm basically chaining promises, where each successful return from server, launches a new http.get() for more information BUT NOT when it errors. No more http.get()s if ...
1
vote
0
answers
2k
views
Ionic v1 AngularJS $http POST request not working
I'm trying to send a POST request to a rest API, but I don't seem to able to do it correctly, I don't know if it's the syntax, or what it could be, I've tried many different ways but nothing seems to ...