Questions tagged [angular-promise]

Angular's $q promises provide a powerful abstraction over flow control. If you tag your question with this tag, consider also tagging it with "promise" tag. This tag is also appropriate for questions about angular and promises not relaying to $q directly.

Angular's $q promises provide a powerful abstraction over flow control. If you tag your question with this tag consider also tagging it with the promise tag.

This tag is also appropriate for questions about angular and promises not relaying to $q directly.

2114 questions
0
votes
1 answer

Angularjs promise not being resolved in controller

I have an ionic (v1) project that uses angular and cordova. I am looping over an array of file names and appending each file data in a FormData object, which has to be uploaded to server. For reading the file data, Cordova/HTML5 provides some…
avck
  • 3,535
  • 3
  • 26
  • 38
0
votes
2 answers

Angular Looping Promises - Function Returns Empty Object

I'm trying to pass a result (array) from a promise to a function that iterates over this result, making a get request for each item and creating a new object with the results before returning it. The problem is that the object is being returned…
neridaj
  • 2,143
  • 9
  • 31
  • 62
0
votes
0 answers

Call a controller with the data results of 2 functions

I am a newbie with Angularjs, and trying to figure it up: in boardService there are 2 function var getLiveCards = function () { return $http.get(endpointService.getLiveCards(), {}) .then(function (response) { …
E.Meir
  • 2,146
  • 7
  • 34
  • 52
0
votes
2 answers

How to handle multiple resource calls on ngRoute view load in angular js

Need you're help in reducing the load time of the application. In our application we use ngroute and in ng-route we have resolve call. Once the resolve call is successful we are making other function calls. Each function call is individual resource…
0
votes
2 answers

How to use an Ng-if with Firebase

I know that the ng-if directive creates a new child scope and I would like to know HOW and IF it is possible to play a ng-if into an other one. For now I can't see any icons. I've tried ng-hide, but I saw the two icons in the same time,…
Memphis
  • 410
  • 5
  • 23
0
votes
0 answers

read response status in angularjs errorCallback

I am trying to read 403 status code(expected) in error call back but I see the following as response object. Object {data: null, status: -1, config: Object, statusText: "", headers: function} The preflight OPTIONS request is getting denied with…
0
votes
2 answers

Is it possible to access scope data in a returned success promise using resource

I have look up all related questions on stackoverflow but did not find any relevant answer. Maybe it's the elephant in the room that only I can't see but after wasting an entire day on this, I would really appreciate if someone can offer some…
0
votes
2 answers

can't get recursive function with conditional promise to return final value

The issue I am having is that I need to get a total count of a collection of objects, which has the form of a tree where each object can also contain deeply nested objects. The collection of data I start with already has one nested layer available,…
0
votes
2 answers

scope variable undefined outside `.then` method

I changed the scope variable in an if statement and outside the if statement it turned into an undefined variable app.controller("Login", function($scope, $window,$http){ var status; $scope.loginUser = function(logData){ …
ultimate_beaver
  • 85
  • 2
  • 12
0
votes
1 answer

How do I return list/value from ionic2/3 storage

I know this probably isn't the 100% right way to do this, so advice for cleanup is also welcome. Just learning/getting used to Ionic2 and I'm having trouble returning the Storage Item. Service: import { Injectable } from "@angular/core"; import {…
Andrew Ice
  • 831
  • 4
  • 16
0
votes
1 answer

How to execute an HTTP request only after a list of n HTTP requests have been executed and completed

I am using Spotify's Web Api. I have an array of songSearches. And for each songSearch within songSearches, a request is made to search for these songs and add it to an array of Songs that I have which hold the track's spotify ID. I need all of…
Luca Guarro
  • 1,085
  • 1
  • 11
  • 25
0
votes
2 answers

AngularJs: how to hold all the $http request if its thrown unauthorised request error refresh token and resume all the request

i have developed single page application in angularjs. i have implemented the refresh token mechanism. refresh token suppose to refresh every 30 minutes. I am trying to handle refresh token in responseError of interceptor. I m trying to hold request…
0
votes
0 answers

Promise.all() not working with angularjs

I have a VPService.requestQueue which is an array of objects with the following content: I need to do something after all promises have been completed so I'm using Promise.all(VPService.requestQueue).then(...) but its not working. I tried making an…
CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186
0
votes
4 answers

$http.post call inside another $http.post

I want to make an $http.post inside another $http.post as the second one is dependant on the first. Basically what I'm doing is: $http.post("/my/server/location").then(function (response) { …
Gaurav Goenka
  • 152
  • 12
0
votes
2 answers

How to iterate through a loop of HTTP requests and store the data of each iteration appropriately to an array

I am using Spotify's API's search functionality to iterate through an array of SongSearchParams defined as: export class SongSearchParams { public title: string; public artist: string; constructor(title: string, artist: string){ …