kendo-labs / angular-kendo

A project to create a robust set of Angular.js bindings for Kendo UI widgets
474 stars 209 forks source link

Kendo UI Grid k-data-bound #406

Closed derekgreer closed 8 years ago

derekgreer commented 8 years ago

I've seen examples of using the k-on-data-bound attribute this way: k-on-data-bound="onDataBound()"

This approach seems wrong/inconsistent to me. I would expect that k-on-data-bound to be assigned to a function, not the results of a function call (i.e. k-on-data-bound="onDataBound"). I would expect that the directive's k-on-data-bound scope variable would be assigned to the function to call at the point it binds to the data source. As seen in this example, the onDataBound() method doesn't return anything, so it would seem that it would simply get executed as part of the angular binding process, not as part of some data binding event raised by Kendo.

Should this not be changed to work with the following syntax?

k-on-data-bound="onDataBound"

leblancmeneses commented 8 years ago

I would think about it this way: k-on-data-bound behaves and is consistent with ng-click and should stay as is. ng-click doesn't consume the results of the action just like k-on-data-bound doesn't either.

derekgreer commented 8 years ago

Yeah, I suppose that makes sense now that you put it that way.