asafdav / ng-s3upload

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

angular attribute does not work #21

Closed ghost closed 10 years ago

ghost commented 10 years ago

In the tutorial, you said we can use the template:

<div s3-upload bucket="s3Bucket" ng-model="product.remote_product_file_url" s3-upload-options="{getOptionsUri: s3OptionsUri, folder: 'images/'}">

I tried, but the attribute does not work, if I changed the bucket="dfsdev" (which is my bucket name), the console report, https://undefined.s3.amazonaws.com/

asafdav commented 10 years ago

You didn't wrap your bucket name with apostrophes so angular is trying to find $scope.dfsdev and obviously it can not be found.

bucket="'dfsdev'" will do the trick.

aforarup commented 10 years ago

Hi,

I did the following in an angular template

.container %div{ "s3-upload" => true, "bucket" => "merchant-dev", "ng-model" => "test", "s3-upload-options" => "{getOptionsUri: '/s3_policy', folder: 'images/'}"}

But there is no visible div. Please help

asafdav commented 10 years ago

What template language do you use ? Did you load the module correctly? Do you get any error ?

aforarup commented 10 years ago

Hey its working now. I use haml. As mentioned above, I also tried with "bucket" => "'merchant-dev'" along with some other tweaks and got it working.

Thanks for the great library

asafdav commented 10 years ago

I'm glad, you are welcome.

On Sat, May 31, 2014 at 3:42 PM, aforarup notifications@github.com wrote:

Hey its working now. I use haml. As mentioned above, I also tried with "bucket" => "merchant-dev" along with some other tweaks and got it working.

Thanks for the great library

— Reply to this email directly or view it on GitHub https://github.com/asafdav/ng-s3upload/issues/21#issuecomment-44747294.