asafdav / ng-s3upload

Upload to S3 using AngularJS
MIT License
190 stars 83 forks source link

compile method - bucket fix? #30

Closed captainmarkos closed 10 years ago

captainmarkos commented 10 years ago

I made this change to get the bucket so it would get set:

var bucket = (scope.$eval(attrs.bucket)) ? scope.$eval(attrs.bucket) : attrs.bucket;

which is ~line# 177 in build/ng-s3upload.js.

var bucket = scope.$eval(attrs.bucket);

The above was coming up with bucket as being undefined.

This is in the compile method belonging to the ngS3upload directive.

StuClift commented 10 years ago

If you don't want to have bucket evaluated in your scope (probably because it isn't defined) you could just pass a string with the attribute.

<div s3-upload bucket="'the-name-of-my-bucket'">
captainmarkos commented 10 years ago

Roger that and thanks!

asafdav commented 10 years ago

Sorry for my lack of response, things are hectic here lately. @GWStuartClift Thanks for your help!