angular-promise Questions
1
Solved
I'm reading a book called MEAN Machine, and as I'm getting to the late chapters, I've got stuck at one of the sample applications, that doesn't seem to work.
The problem seems to occur because my ...
Pterous asked 14/3, 2015 at 14:21
3
Solved
I've recently learned that ngResource request can be aborted either by specifying a timeout in ms or passing a deferred object.
The second solution does not seem to work for me, and I have no idea...
Phip asked 13/2, 2015 at 10:20
1
Solved
I feel like I am going a little crazy, but Angular appears to throw an error for a promise even if I have a catch defined. It throws the error to the console, then allows the catch to run.
Here is...
Macy asked 23/2, 2015 at 20:22
1
Solved
I have the following fiddle:
http://jsfiddle.net/thelgevold/3uv9nnjm/6/
angular.module('hello',[]).controller('helloController',function($q){
console.clear();
function someService(){
var defer...
Unfruitful asked 11/2, 2015 at 4:56
1
Solved
I am new to angularjs. My goal is very simple. I want to make an ajax call to get data and, once complete, I want to make a second call to get another set of data that is dependent on information i...
Booze asked 8/2, 2015 at 3:53
2
Solved
I am having some trouble getting a retry function to work and was hoping for some assistance. I have a $resource that I want to have called until a success condition occurs or the maximum retries h...
Daven asked 10/1, 2015 at 15:4
3
Solved
So I have a method in a angularjs server that is calling a method that returns a promise for each method in a array. I am using underscore _each to loop through the array. I want to wait until the ...
Conversational asked 4/9, 2014 at 17:38
3
I want to know if it is possible to make a service call that uses $http so it returns data directly without returning a promise? I have tried to use the $q and defer without any luck.
Here is what...
Probe asked 1/12, 2014 at 22:59
2
Solved
I'm trying to test a service that I build which uses Angular's $q implementation of Promises. I'm using a combination of Karma, Mocha, Chai, Sinon, Sinon Chai and Chai as Promised.
All the tests t...
Vincenza asked 5/11, 2014 at 7:33
1
Solved
I am trying to find a way to break out of a promise chain in AngularJS code. The obvious way was to return an object and then check is validity in every "then" function in the chain.
I would like ...
Xerophagy asked 6/11, 2014 at 13:51
3
Solved
I need to use $q a link function of my directive. I need it to wrap possible promise that is retuned by one of arguments (see the example below). I don't know however, how to pass $q dependency to ...
Potassium asked 28/10, 2014 at 10:49
1
Solved
Have a question about synchronizing nested promises when using $q in Angular.
Will the following code ensure that the entire chain of promises is waited for? Meaning will the nested calls to servic...
Shebat asked 3/10, 2014 at 18:7
3
Solved
So I'm running into this problem where I'm using ngView and I have a navigation bar that is static throughout like so:
<div ng-include="'views/nav.html'" ng-controller="NavCtrl"></div>...
Scissel asked 3/10, 2014 at 14:7
2
Solved
I'm having trouble wrapping my head around promises. I'm using the Google Earth API to do a 'tour' of addresses. A tour is just an animation that lasts about a minute, and when one completes, the n...
Gunstock asked 30/9, 2014 at 15:46
1
Solved
I am using $q to wrap a promise around a legacy callback. However, the existing callback doesn't have a value to return. It takes a success function with no parameters.
angular.module('MyModule')....
Frisch asked 27/9, 2014 at 0:49
2
Solved
I have a chain of $http calls to server. If one call fails I want to display notification to user and stop the chain. At first I thought I can use the $q.reject to stop the chain, but it turned out...
Pyrognostics asked 22/9, 2014 at 13:15
1
Solved
I am writing a browser app, and I have a file that creates an object and initializes it. The app is written in AngularJS, but the file in question is plain Javascript, outside the Angular ecosystem...
Ygerne asked 15/9, 2014 at 23:9
3
I'm trying to execute a check once promise gets fulfilled in angularjs.
request.then(function(res){
$ionicLoading.hide();
deferred.resolve(res);
}, function(res){
$ionicLoading.hide();
deferr...
Viviyan asked 4/9, 2014 at 16:52
1
Solved
I'm trying to write tests for a method that returns an angular promise ($q library).
I'm at a loss. I'm running tests using Karma, and I need to figure out how to confirm that the AccountSearchRe...
Gutow asked 18/8, 2014 at 18:23
4
Solved
LIVE DEMO
Given the following function:
function isGood(number) {
var defer = $q.defer();
$timeout(function() {
if (<some condition on number>) {
defer.resolve();
} else {
defer.reje...
Humorous asked 12/8, 2014 at 11:58
2
Solved
I have 3 services that return 3 promises, but the third needs the data from the second, so I call it inside the second. I want to wait for all the three promises to be solved, this is the way that ...
Mizzen asked 31/7, 2014 at 18:7
2
Solved
I need to load some data on page load and then do execute a task. in order to get the data i want i execute multiple different ajax calls. But in order to execute the task, i need all to make sure ...
Philippi asked 31/7, 2014 at 9:43
1
Solved
Are the following code snippets equivalent?
Version 1
function doSomething() {
var defer = $q.defer();
foo().then(function() {
bar().then(function() {
defer.resolve();
});
});
return def...
Unify asked 29/7, 2014 at 11:51
2
I need to get some information (a schema) from the server before I set up a bunch of services that depend on that information.
My server provides a schema that defines various properties of a mode...
Acquit asked 2/8, 2013 at 13:51
1
Solved
I want to chain some promises that are returned by services. This works, as long as some of the methods that return the promises, doesn't require additional parameters. This is my example:
var fir...
Hugh asked 23/7, 2014 at 11:52
© 2022 - 2024 — McMap. All rights reserved.