Top "Promise" questions

Promises are a tactic for deferred computing, suitable for several styles of concurrency: thread and event loop concurrency for local computation, and both synchronous and asynchronous remote messaging.

How to create an Observable from static data similar to http one in Angular?

I am having a service that has this method: export class TestModelService { public testModel: TestModel; constructor( @Inject(Http) public http: …

typescript promise angular observable rxjs
Axios handling errors

I'm trying to understand javascript promises better with Axios. What I pretend is to handle all errors in Request.js …

javascript promise axios
How to include multiple js files using jQuery $.getScript() method

I am trying to dynamically include javascript files into my js file. I did some research about it and find …

javascript jquery html promise
How to cancel an $http request in AngularJS?

Given a Ajax request in AngularJS $http.get("/backend/").success(callback); what is the most effective way to cancel that …

angularjs promise angular-promise angular-http cancellation
How to return a resolved promise from an AngularJS Service using $q?

My service is: myApp.service('userService', [ '$http', '$q', '$rootScope', '$location', function($http, $q, $rootScope, $location) { var …

javascript angularjs promise angular-promise
Angular HttpPromise: difference between `success`/`error` methods and `then`'s arguments

According to AngularJS doc, calls to $http return the following: Returns a promise object with the standard then method and …

angularjs promise
return value after a promise

I have a javascript function where I want to return the value that I get after the return method. Easier …

javascript node.js promise q
How to pass parameter to a promise function

this might seem a silly question but I am a newbie in this topic. I am working on promises on …

javascript node.js promise
How do you properly return multiple values from a promise?

I've recently run into a certain situation a couple of times, which I didn't know how to solve properly. Assume …

javascript promise q
Error handling in AngularJS http get then construct

How can I handle an HTTP error, e.g. 500, when using the AngularJS "http get then" construct (promises)? $http.get(…

javascript angularjs promise angular-promise angular-http