angular-promise Questions
1
I want to send a $http.get if the page gets closed. Then I stumbold upon a problem where
promises can't get resolved because if this one last method returns, the page gets destroyed.
The following...
Cavort asked 2/4, 2016 at 21:52
1
Solved
I have a function F that starts an asynchronous process X. The function returns a promise that is resolved when X ends (which I learn by means of a promise returned by X).
While the (w.l.o.g.) fir...
Deadeye asked 27/2, 2018 at 8:35
2
Solved
I am trying to fetch a list of users from my firestore database, and determine if the logged in user is an admin (i.e. he's in the list).
This is my code:
isAdmin(user: any): boolean {
var col ...
Osugi asked 11/2, 2018 at 15:49
3
Solved
I am able to successfully perform a Promise.all, and gracefully handle resolves and rejects. However, some promises complete within a few milliseconds, some can/could take a while.
I want to be ab...
Droplight asked 2/2, 2018 at 7:26
4
I have a problem converting the promise returned by the service to the controller. What I want is to create an array of JSON objects from the data contained in promise. Here is what I receive in th...
Immortelle asked 2/6, 2017 at 14:40
1
Solved
I'm working on a Angular4 + PHP website, where i send HTTP requests to the server using Promise, since i want my application to perform routing according to the response of the server. I want...
End asked 2/1, 2018 at 16:21
4
Solved
I have an angular service that wraps my rest api calls and returns a $http promise.
My question is how do I throw an error so that a promise that triggers the .error method gets called? I don't wa...
Omegaomelet asked 5/11, 2014 at 14:0
4
Solved
I want to have a for-loop which calls async functions each iteration.
After the for-loop I want to execute another code block, but not before all the previous calls in the for-loop have been resol...
Acidosis asked 9/1, 2014 at 15:31
9
Solved
I have a code with AngularJS:
service.doSomething()
.then(function(result) {
//do something with the result
});
In AngularJS 1.5.9 when I have error in the .then() section like:
service.doSo...
Tui asked 22/12, 2016 at 10:56
1
Why axios callback changes are displayed in angularjs, without using $apply
I was trying axios library on angularjs and I was surprised when I saw that the changes to $scope in the axios callback w...
Warren asked 2/10, 2017 at 7:55
1
Solved
I've read the Promise/A+ specification, but as far as I understand there are also such things as Promise/A and Promise. What is the difference between all of them? Are Promise and Promise/A specifi...
Dealer asked 30/9, 2017 at 20:26
3
Solved
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,
b...
Clarkia asked 11/9, 2017 at 9:35
1
Updated.
I am Following Angular2 tutorial from
https://angular.io/docs/ts/latest/tutorial/toh-pt4.html
Here is the call to HeroService from heroes.component.ts,
Heroes.component.ts
import { C...
Prorate asked 26/5, 2017 at 13:27
1
Simple and common Angular2+ data service that handles errors and uses Promises:
// imports skipped
class DataType {}
class Error {
constructor(error: HttpResponse) {
this.error = error.json()...
Tungus asked 13/8, 2017 at 7:30
1
I created a drag and drop fake upload service. I can log the width and height of the picture as well as the url. However the image is not uploading.
The problem is that the 'img' in my upload funct...
Phip asked 18/7, 2017 at 12:46
4
Solved
With jQuery deferreds I'm used to be able to check the current state like this:
var defer = $.Deferred();
defer.state(); //Returns the state of the deferred, eg 'resolved'
Is there a way to do t...
Cerebroside asked 6/6, 2014 at 22:24
7
Solved
What happens with $q.all() when some calls work and others fail?
I have the following code:
var entityIdColumn = $scope.entityType.toLowerCase() + 'Id';
var requests = $scope.grid.data
.filter...
Endear asked 13/11, 2013 at 3:51
7
Solved
In the promise library Q, you can do the following to sequentially chain promises:
var items = ['one', 'two', 'three'];
var chain = Q();
items.forEach(function (el) {
chain = chain.then(foo(el));...
Mercie asked 6/9, 2014 at 21:6
0
I'm following the tutorial "Angular Tour of Heroes" at the Angular.io site.
I've setup the project with Angular CLI (see environment versions at the end of this post).
I'm stuck at point 5 (servi...
Landmass asked 27/5, 2017 at 11:54
3
I need to make an api call that returns me a response of id's and values associated with it. The promise then resolves and returns a true or false if the id queried was found or not found.
How can...
Dowson asked 24/5, 2017 at 19:6
2
Solved
I started using promises in angular for resolving my api calls with the following syntax:
$scope.module = moduleFactory.get({id: $stateParams.id})
.$promise.then(function(response){
$scope.modu...
Varuna asked 25/2, 2017 at 11:17
5
Solved
In the following code, an exception is caught by the catch function of the $q promise:
// Fiddle - http://jsfiddle.net/EFpn8/6/
f1().then(function(data) {
console.log("success 1: "+data)
return ...
Shareeshareholder asked 27/4, 2014 at 15:1
2
Solved
I'm having trouble understanding angular components scope. If I do something like:
function myComponent(){
this.data = 'Hello World';
}
let myModule = angular.module('myModule', []...
Junco asked 9/2, 2017 at 1:19
2
Solved
After Refering this Link , I am trying to get JSON data into my angular service.
Service:
.factory('restservice', ['$rootScope','$http', '$q', '$log',
function($rootScope,$q, $http) {
return {
...
Handclasp asked 3/10, 2015 at 14:25
3
Solved
New TypeScript async/await feature uses ES6 promises. AngularJS uses $q service promises with slightly different interface.
Is there any way to use TypeScript async/await feature with $q service p...
Constitutional asked 25/2, 2016 at 13:52
© 2022 - 2024 — McMap. All rights reserved.