uploadcare / angular-uploadcare

Provides a directive for the Uploadcare widget.
MIT License
37 stars 16 forks source link

Make ngModel for hidden input field work with parent scope #3

Closed Morpho closed 9 years ago

Morpho commented 9 years ago

It just doesnt work without this..

dmitry-mukhin commented 9 years ago

seems legit! can you add a brief comment to describe why we need those lines?

Morpho commented 9 years ago

It's needed because angular-js doesn't do two-way databinding for input[type=hidden] fields: https://github.com/angular/angular.js/pull/2574

dmitry-mukhin commented 9 years ago

I was referring co comment in the code)

dmitry-mukhin commented 9 years ago

I forgot to thank you, sorry about that. Thanks!

homm commented 9 years ago

@Morpho Could you elaborate where $parse and $attrs comes from? Should them be declared somewhere?

dmitry-mukhin commented 9 years ago

@Morpho @homm I believe that this should help

- controller: ['$scope', '$element', '$log', function($scope, $element, $log) {
+ controller: ['$scope', '$element', '$log', '$parse', '$attrs', function($scope, $element, $log, $parse, $attrs) {
dmitry-mukhin commented 9 years ago

fixed in #9