ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

Access to the scope ? #116

Closed warpdesign closed 8 years ago

warpdesign commented 8 years ago

I am using colorPicker inside a ng-repeat, like this:

<div ng-repeat="obj in objects">
  <color-picker ng-model="obj.color" ... />
</div>

It's working as expected, but the problem is that I need to have access to the current obj from my onChange event and I don't think it's possible right now: change callback only passes the $event, color and api object.

Any idea how I could do that ?

ruhley commented 8 years ago

I have added a new feature api.getScope() which should give you what you need. Released in v2.5.0

warpdesign commented 8 years ago

👍 Thanks!