Last active
August 29, 2015 14:02
-
-
Save bholzer/1b21106ec77d07d532a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$files.forEach(function ($file) { | |
console.log('Should request'); //This runs as many times as there are images | |
var filePromise = $http.post('/api/images/upload').then(function (aws){ //This request runs only once | |
console.log(aws) //This also runs as many times as there are images, but aws is same EVERY TIME. | |
//Go on to upload file to S3 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment