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

Get a value from a promise chain in another class

I am trying to get the value of a queried ID called from another class however when I call the function it gives me a promise chain and not the value I am looking for. The method in the class 'Helper' is below function querySF() { var conn =…
Nicole Phillips
  • 753
  • 1
  • 18
  • 41
0
votes
1 answer

Delay $http.get call without affecting angularjs promise

Please note that I already read all the StackOverflow questions that are somewhat related to my questions but none of these really answer my question. Please don't mark this as duplicate without fully understanding my question. Here's my concern: I…
sta-vanger
  • 38
  • 4
0
votes
0 answers

Checking for Angular $http type on $resource error

In Angular 1.6.x I may have several promise invocations, involving e.g. a dialog display, an HTTP call using $resource, and some processing: showDialog() .then(foo => { return sendDataToServer(foo); //uses $resource }) .then(bar => { …
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
0
votes
1 answer

Promise catching the results inside the promise structure

Here is my entire code, and what I want to avoid are all the moveAllBank, moveAllReceipt moveAllExpense functions if possible. The code below works fine, I just wish there was a smarter way of doing it. Its really hard to understand how the…
torbenrudgaard
  • 2,375
  • 7
  • 32
  • 53
0
votes
2 answers

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 it causes an…
Dexter
  • 6,170
  • 18
  • 74
  • 101
0
votes
1 answer

angularjs $q.defer() Object doesn't support propert or method 'defer'

Hi I'm facing an issue where I'm trying to inject $q to a controller and use defer() but it throws an error "TypeError: Object doesn't support property or method 'defer'" I know injecting $q into controller would work with coding style below, but…
CionC
  • 3
  • 2
0
votes
2 answers

Multiple GET requests in Angularjs

I want to make multiple ajax calls from different urls in football-data.org API. Here's my code sample: angular.module('liveFootball', ['ionic']) .constant('urls', { BASE: 'http://api.football-data.org/', BASE_API:…
Aoguzie
  • 35
  • 9
0
votes
0 answers

How to display image list from firebase storage in Angular2?

I want to display images in a list which are fetched from firebase database and firebase storage. Following is my code, when I run it browser got unresponsive. Please help me to fix this. HTML:
0
votes
1 answer

How can I convert a vanilla JS stop watch to a Angular one?

new to JS and will delete if not allowed. I have got some regular JS code which I have been working with trying to switch this into a controller. For the given example what would be the most optimised way. I have seen cases with directives,…
Fabian
  • 25
  • 8
0
votes
2 answers

Ajax call inside forEach loop Angular

I am having an Array that contains objects in AngularJS. Based on the value of a property (snooz) of these objects I have to call a POST request (getData.sonnzeUpdate()). After going through each object in the array, finally, I have to call a GET…
SSS
  • 303
  • 1
  • 2
  • 9
0
votes
1 answer

$q.all() not calling fail handler if one promise fails

Just trying to understand how the $q.all() works: In my example, i use $q.all() to execute 2 functions (both intentionally return reject() ), i expected the fail handler in the then() to get called, but it doesnt, why is this so? Code: var myApp =…
Sajjan Sarkar
  • 3,900
  • 5
  • 40
  • 51
0
votes
1 answer

AngularJS display a promise from Firebase

I am sure it is a simple problem, but since I work in angular for like 2 weeks now I can't seem to figure it out. I have this facebook login with firebase function: function FBLogin(){ var provider = new firebase.auth.FacebookAuthProvider(); …
Boanta Ionut
  • 402
  • 8
  • 24
0
votes
1 answer

AngularJS - not getting return value to controller or view

I'm doing a geolocation and reverse geocoding application. Function is bound to a button-click to call a function in my controller to my service. The service works somewhat, it's getting values but I cannot get it to return the value to my…
0
votes
1 answer

Sequencing promises in AngularJS

I'm trying to do the following: Function that returns a promise that checks if a directory exists (it creates is if it doesn't) Then copy a file to that created directory. The way I'm doing it, the copy the file part gets executed before the…
Franch
  • 621
  • 4
  • 9
  • 22
0
votes
1 answer

cg-busy on consecutive promises

I have a factory which stores and periodically updates some data using a service($http call). I want the busy indicator in the view every time the data is being updated. The factory exposes the data object and the promise. angular.module('myUI') …
NeplatnyUdaj
  • 6,052
  • 6
  • 43
  • 76