Kendo UI SPA and Require.js

added by JavaScript Kicks
10/17/2014 7:55:36 AM


As you build a Kendo UI single-page app, one of the first decisions you will have to make is how you want to organize your code. Unlike some other SPA frameworks, for example Durandal, Kendo’s SPA implementation doesn’t do much to dictate your code layout. One approach I like to take is to use Require.js to separate my views and view models into their own files. This helps to keep proper separation of views and their logic, and also sets up dependency injection. One nice feature of the Durandal SPA framework is that it supports this concept out-of-the-box by using Require.js and its Text plugin to load views and view models remotely. Inspired by this concept, I built a kendo-template plugin for Require.js that can be used to load SPA views from separate HTML files.