Skip to content

Commit

Permalink
Added file path to s3upload:success #36
Browse files Browse the repository at this point in the history
  • Loading branch information
asafdav committed Sep 28, 2014
1 parent 3269415 commit e1d902d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions build/ng-s3upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ angular.module('ngS3upload.services', []).
if (xhr.status === 204) { // successful upload
scope.success = true;
deferred.resolve(xhr);
scope.$emit('s3upload:success', xhr);
scope.$emit('s3upload:success', xhr, {path: uri + key});
} else {
scope.success = false;
deferred.reject(xhr);
Expand Down Expand Up @@ -193,7 +193,7 @@ angular.module('ngS3upload.directives', []).
var selectedFile = file[0].files[0];
var filename = selectedFile.name;
var ext = filename.split('.').pop();

S3Uploader.getUploadOptions(opts.getOptionsUri).then(function (s3Options) {
if (opts.enableValidation) {
ngModel.$setValidity('uploading', false);
Expand Down Expand Up @@ -242,9 +242,7 @@ angular.module('ngS3upload.directives', []).
});

if (angular.isDefined(attrs.doUpload)) {
console.log('attrs.doUpload', attrs.doUpload);
scope.$watch(attrs.doUpload, function(value) {
console.log('doUpload value', value);
if (value) uploadFile();
});
}
Expand Down
2 changes: 1 addition & 1 deletion build/ng-s3upload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ng-s3upload/services/s3-uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ angular.module('ngS3upload.services', []).
if (xhr.status === 204) { // successful upload
scope.success = true;
deferred.resolve(xhr);
scope.$emit('s3upload:success', xhr);
scope.$emit('s3upload:success', xhr, {path: uri + key});
} else {
scope.success = false;
deferred.reject(xhr);
Expand Down

0 comments on commit e1d902d

Please sign in to comment.