angular-promise Questions
3
Solved
Although I am working with the HTTP promise object in AngularJS, I don't have a clear concept of what an HTTP promise object actually is and what the is difference between an HTTP promise object an...
Inosculate asked 20/11, 2016 at 14:51
2
Solved
I tried using Angular with Bluebird promises:
HTML:
<body ng-app="HelloApp">
<div ng-controller="HomeController">{{name}} {{also}}</div>
</body>
JS:
//...
Holeandcorner asked 1/6, 2014 at 21:6
2
Solved
I really like the clean (and I think easy to follow) way that promises were autounwrapped:
$scope.myData = DataService.query({something:"etc"}); // done;
And I really don't care for what seems t...
Cleanlimbed asked 1/7, 2014 at 19:50
2
Solved
Below is my code, I want login() and authenticated() functions to wait for getProfile() function to finish its execution. I tried several ways like promise etc. but I couldn't implement it. Please ...
Heartbreaking asked 22/9, 2016 at 17:38
1
Solved
I'm pretty new to Angular and I am working to test an Angular service that runs off an API level service which wraps a bunch of calls to a REST service. Because it is working with HTTP requests, bo...
Benilda asked 31/8, 2016 at 17:9
0
I created a short example of an Angular 2 application built with NativeScript, what I expect is the variable foo to be "foo" at the beginning, then the ngOnInit() first change it to "bar" and then ...
Somite asked 29/8, 2016 at 9:37
1
Solved
I would like to return exception message to the AngularJS UI.
As a back-end I use ASP.NET Core Web Api controller:
[Route("api/cars/{carNumber}")]
public string Get(string carNumber)
{
var jso...
Maxama asked 7/8, 2016 at 13:43
3
Solved
I have the following q.all calling to resolve two promises. I checked all the posts and tried all other ways of implementation q.all and its the same case
var xyzdeffered = $q.defer();
service1.ge...
Mariannemariano asked 14/5, 2015 at 21:55
4
Solved
Question:
Is there an "easy" way to cancel ($q-/$http-)promises in AngularJS or determine the order in which promises were resolved?
Example
I have a long running calculation and i request the r...
Roundshouldered asked 8/7, 2016 at 11:11
10
Solved
I have an AngularJS service that I want to initialize with some asynchronous data. Something like this:
myModule.service('MyService', function($http) {
var myData = null;
$http.get('data.json')...
Disciplinary asked 29/4, 2013 at 19:25
3
Solved
I am currently using $q service from angular to make API calls like this:
var deferred = $q.defer();
$http.get(config.apiHost + details.url)
.success(function (data) {
deferred.resolve(dat...
Laszlo asked 28/6, 2016 at 15:19
1
Solved
Chai as Promised documentation states as follows:
Notice: either return or notify(done) must be used with promise assertions.
And the examples on the site are as follows:
return doSomethingA...
Padova asked 22/6, 2016 at 17:28
2
Solved
What's the equivalent of Angular's $q in Angular2?
Specifically, I'm looking for $q.when, which allowed you to do something like:
return $q.when(['TestResponse']);
Picked asked 9/6, 2016 at 7:20
2
Solved
I have the following chained sequence of promises:
$scope.promisesInProgress = true
myService.myFirstPromise(id)
.then(function(data){
$scope.firstResponse = data;
return myService.mySecondProm...
Eccentricity asked 6/5, 2016 at 15:19
2
Solved
I am new to the AngularJS, I need to access the variable which is assigned inside the promise in Javascript
this.reqData= this.profileService.getData();
var resp1 = angular.fromJson(this.reqData);...
Patroclus asked 22/4, 2016 at 15:4
1
I am having a problem where my code mixes ES6 Promises with Angular promises, and it works in production by I cannot write unit tests that pass.
This code snippet demonstrates two instances where ...
Francefrancene asked 27/11, 2015 at 22:17
1
As i am trying to use promise to create html5 directory functions in angularjs.
but it shows error as promise not defined.
Angular file:-
$scope.createDirectory = function(dirName,dirLocation){
...
Yorgos asked 3/4, 2016 at 8:36
4
I still can't understand the role of using the $q service, (what exactly will it add) if you want to create a service that need to call only one API via http , in this situation I don't know why sh...
Abydos asked 1/4, 2016 at 20:46
3
Solved
I'm trying to understand the promise API and chaining, particularly the timing when $timeoutis used with .then(). What I had expected from the following is that since $timeout returns a promise, .t...
Ure asked 8/3, 2016 at 4:9
2
Solved
I have seen answers on StackOverflow where people suggest furnishing a callback function to an AngularJS service.
app.controller('tokenCtrl', function($scope, tokenService) {
tokenService.getToke...
Farm asked 26/2, 2016 at 20:13
3
Solved
As the success() and error() functions are deprecated in AngularJS, I am updating my codes, replacing them with then(). Now according to my understanding, these two pieces of codes should beh...
Yukoyukon asked 15/2, 2016 at 17:39
1
I have a global error handler for my angular app which is written as an $http interceptor, but I'd like to take it a step further. What I'd like is for each $http call that fails (is rejected), any...
Clio asked 29/11, 2015 at 2:55
1
Solved
We currently are trying to test our angular services which use promises to return values to the controllers. The issue is that the functions we attach to the .then do not get called in Jasmine.
We...
Roughcast asked 22/9, 2015 at 13:14
4
-- EDIT --
I encountered a weird thing recently about promises, but I guess it's maybe because it's against the philosophy of promises.
Considering the following code :
// Assuming Auth is just...
Lotson asked 21/12, 2015 at 15:38
1
Solved
Following Approach works:
$q.when()
.then(checkCookieToken) // check if cookie already exists e.g. in cookie
.then(setHeader) // set Header with REST-Token e.g from cookie
.then(checkTokenOnlin...
Guaco asked 16/12, 2015 at 23:32
© 2022 - 2024 — McMap. All rights reserved.