Questions tagged as 'promesas'

2
answers

Send data to the server using Ajax using JavaScript Promises

Since the Javascript Promises promise a lot. One of the things that I would like to know is how to make an Ajax request with promises , in pure Javascript, without having to go through third-party libraries. It would be a request that adequa...
asked by 14.07.2017 / 15:23
2
answers

Differences between nested AJAX and promises

In another question of StackOverflow in Spanish is done reference to nested AJAX calls and the response suggests using promises instead of nesting AJAX calls. And from there I have some doubts. Note: I'm going to use jQuery notatio...
asked by 02.02.2016 / 23:53
2
answers

Learning promises, does not execute sequentially

I am learning promises , and I was doing some examples. This is my code in which I intend to show.    the following: // one, two, three, four but instead shows   asynchronously // one, four, two, three let promise =new Promise(function...
asked by 30.10.2016 / 17:01
1
answer

Javascript promises, ajax requests ()

Greetings, I have been struggling for a long time with a problem that I can not solve, I hope you can help me, I have reviewed many callback tutorials and promises but I can not solve my problem. Basically I need to make a request $ .ajax...
asked by 05.01.2017 / 07:23
2
answers

Get the value of a promise

I'm having a lot of trouble getting the value of a promise . Basically I want the value that returns a promise to be assigned to a variable. For example    This example uses the following elements: vue. js , vuex , almacen is a syno...
asked by 27.03.2017 / 04:06
1
answer

Obtain data of a promise in an Angular directive

I am working on a directive that needs information to work. This information must come from a promise. The problem is that the directive loads without the information because the promise takes more time to execute than the directive itself. Then...
asked by 22.09.2016 / 23:25
2
answers

Doubt about Promises and async await?

I'm seeing the promises and async await in JavaScript. The syntax to generate both if I understand it and I can create them. What I do not understand is because we use async await if the promises are already created to generate asynchronous task...
asked by 17.10.2018 / 11:58
1
answer

Take data out of a function

Good, I need to get the variable "users" of this function and the for loop, I thought about using promises but I'm new with that and I can not find the round var ids = [ "RtSG7NApoda9ycDRd7vm", "TnT9XOXnkD1Ra5ROJERR", "55fAOlOlej...
asked by 23.01.2018 / 22:04
1
answer

Difference between then, observable and subscribe

I have seen some codes where the functions of then , observable , and subscribe are used. I'm not sure but I think that all are doing the same, I would like to know with an example if it is possible what is the difference betw...
asked by 12.06.2018 / 17:23
1
answer

My promise does not call then () on a karma test

I have a problem making mocks with promises for a test with karma: When I execute the "resolve (value)" of my promise, it does not jump to the then , does nothing, does not go to the "error", does not go to the "resolve" and the test is it r...
asked by 06.06.2018 / 17:22