formly-js / angular-formly-templates-material

Angular-Formly: Material Templates
MIT License
55 stars 39 forks source link

Bind callback functions for chips and select by using statement #45

Closed ghost closed 8 years ago

ghost commented 8 years ago

The callback function for the chips and select type have to be bound by using statement instead of bound. Fixes #43

kamilkisiela commented 8 years ago

@bitecodes Awesome! :fireworks:

Could you explain to me why we provide $modelValue, $inputValue, scope, $event as arguments?

If I understand correctly, there is only one argument $event source

ghost commented 8 years ago

These are the 4 arguments that formly will pass to the function. Have a look at http://docs.angular-formly.com/docs/ngmodelattrs where they talk about using statement with functions.

I think these are the arguments you would like to have access to on the select type, but you are right that it does not make a whole lot of sense for the chips as one would like to know which chip was added, removed or selected. This might mean that it won't work with ngModelAttrs and there the attributes have to be added manually in the link function.

What do you think?

kamilkisiela commented 8 years ago

Oh, of course yes! My bad, I haven't been using angular-formly for a while.

Thank you soooooo much!