Wednesday, June 26, 2013

Kendo UI team made a beautiful AngularJS API

Kendo UI team's first foray on making an AngularJS API for Kendo UI. Angular Kendo UI v 0.0.9


function MyController($scope) {
  $scope.model = kendo.observable({
    var things = [ "Thing 1", "Thing 2", "Thing 3" ]
  });
}

// page
// No need to call bind, the AngularJS directive does it for you
<select id="things" data-role="dropdownlist" data-model="model" data-bind="source: things">
</select>


After pondering their Angular API above and feeling happy but not satisfied, they might have said something along these lines "Darn, that's not intuitive! Let's scrap MVVM observable noises and all that shiznit, JSON objects should be directly bindable to our widgets". Thus upon realizing that, Kendo UI Developer Relations team (their relationship to users/developers must be very important to give their team a name like that) made a second attempt to make their Angular API beautiful and less obnoxious by removing the observable thingie, and let the component users feel the magic by enabling the JSON objects be directly bindable to their Kendo widgets.


Contrast the above API with the following more intuitive API. This is the API that even a CTO would love to develop things around. Angular Kendo UI v 0.5.0


function MyController($scope) {
  $scope.things = [ "Thing 1", "Thing 2", "Thing 3" ]
}

<select kendo-drop-down-list k-data-source="things" k-option-label="'Select A Thing'" ></select>


Happy But Not Satisfied Coding! ツ


Read the rest at: http://www.kendoui.com/blogs/teamblog/posts/13-06-24/announcing-angular-kendo-ui.aspx

No comments:

Post a Comment