Considering the example below:
function retornaValor (){
return promiseQueveioDeAlgumaLib.then(
function(oQueQueroRetornar){
return {
sucesso: true,
data : oQueQueroRetornar
}
},
function(opsAlgoErrado...
How can I create semaphores in JavaScript?
I have an asynchronous script that runs n times, I would like it when the n tasks terminate another task to be executed. I used normal access to a variable but this can cause race condition.
Promise...
I have a scenario in which I make various Ajax calls to a WebApi and with the return I load controls from an application.
I would like to create a single method to call the API, which would receive a parameter with the link, for example 'api...
I would like to save the return of an asynchronous function. The function is as follows:
cb.tabela(serie).then(function(tabela) {
console.log(tabela);
}, function(err){
console.log(err);
});
What I wanted was to be able to do someth...
I have a factory that must access two other services. Being the following structure:
angular.module('my.module')
.factory('ServiceMain', ServiceMain);
ServiceMain.$inject = ['ServicePrimary', 'ServiceSecondary'];
function ServiceMain(Service...
I'm not getting any way to make a part of the code that works with promises work. In the code, I do a check in arrays (obtained by a json) to know if youtube video is blocked or not, however, I need the rest of the method to wait for that part t...
Good morning,
I have a problem with returning a webservice, I make a query to get Categories, and then another to get the items in that category. The goal is to set a return on the pattern:
{
"categoryId" : 1, <--- resultad...
If you can help me, please.
I need to make a call in the API but there are a lot of data and I want Angular to wait for this term, at that moment I put a promise but it does not wait and as long as the API is handling the data on the NodeJS s...
Personal I am new to IONIC / Angular and I do not understand it yet very well Promise / Observable and would like a help!
I have the following situation:
User clicks a button that will fetch information from the phone's SQLite;
A foreach i...