Questions tagged as 'promesas'

1
answer

Transition to dynamically created elements

I am creating a system to upload images with drag and drop, the idea is that each image is added by appearing in a grid, I use promises so that the image only appears when it is already loaded with the onload event, but not I get it to appear wi...
asked by 17.04.2017 / 04:46
1
answer

Error with promise and cycle for

I'm starting with Javascript and I still do not handle the asynchronous topic well, promises ... etc The question is, that within a callback I need to access the data of an array (traverse it through a for) and this throws me an error that I...
asked by 31.08.2017 / 13:47
1
answer

I can not get a POST with express (NodeJS)

I started to develop a small cahtbot with IBM technology (Watson), I'm using NodeJS for the development part of the application. I am using Express as a routing framework, I have also divided the project into views, routes and the server. I foun...
asked by 28.08.2018 / 22:40
1
answer

Nodejs, Mongodb and Promises

I need to know how to execute Nodejs in a correct and orderly way:    Connect with Mongo.    Execute query (Insert, Select, Update, Delete)    Return results    Close connection.    My idea is that whenever you need to make a query, c...
asked by 16.05.2017 / 07:17
1
answer

Failed to redirect in a promise

Good morning. I'm doing a script in which ajax performed a process of insertion in BD depending on what returns this function ajax I need to reload the same page or clean the form, if everything goes well continue with another function ajax i...
asked by 03.01.2019 / 07:51
1
answer

Collect in an object the responses received from 3 URLs via fetch

Good I am trying to compile in an array the objects that I get from the calls fetch () at 3 url. let log = console.log; let datafile1 = fetch('http://s3.amazonaws.com/logtrust-static/test/test/data1.json'); let datafile2 = fetch('http://s3.ama...
asked by 19.09.2018 / 17:07
1
answer

Chaining promises in TypeScript - Angular 2

I have an application that consumes a REST API. With a GET I get a JSON and within that JSON there are several URLs with which I also do GET. For the purpose of the application I have to be careful with the synchronization (hence I use promises)...
asked by 26.05.2017 / 00:58
2
answers

doubt about promises Javascript

function promise(){ return new Promise(function(resolve,reject){ setTimeout(function(){ JSON.parse('ok'); //disparando excepción },100); }); } promise() .then(null,function(error){ alert('entrando...
asked by 21.04.2017 / 13:31
1
answer

Simulate load event in a javascript class

I have a class with an ascynchronous method that defines several properties of my object, what I want to achieve is to obtain these properties but only when they were already defined by my method, something like the load event of the html elemen...
asked by 19.02.2017 / 02:13
1
answer

Save function value base64 in array?

I am working on an application in ionic framework and I need to send the following object by $http by post method. $scope.project = { name: '', description:'', location: '', imgs: {}, video: '' }; I ha...
asked by 20.08.2016 / 08:44