Thursday, September 18, 2014

Angular.js and KendoUI: be careful when specifying widget options

Although combining Angular.js and Kendo UI is really easy, there is one thing that bit me in the food when I first started combining the two.

Let’s have a look at some code I wrote:

And then have a look at this code:

Do you see the difference?

If you look carefully you should notice that the string ‘c2’ (to format the number as a currency) is quoted inside the attribute values. Without the single inside they will be interpreted as variable names and Angular-Kendo will look for $scope.c2.

Luckily Angular-Kendo will emit a warning in the JS console when such variables are not found.

No comments: