4/09/2014

Using Knockout-Kendo Bindings with RequireJS

There is a project called Knockout-Kendo bindings in github which provides binds for each kendo widget and allows to use only knockout bindings.
https://github.com/kendo-labs/knockout-kendo/tree/master/src
The project is AMD supported but you need to be careful when giving aliases to your paths. It is important to know that the project is dependent on jquery,knockout and kendo.
I assume you are using web version of Kendo.
If you want to include it to your project using RequireJS, the following configuration can be used in your in main js file:
I imported all of vendor specific filed into my lib folder.
requirejs.config({
    paths: {
        'knockout': '../lib/knockout/knockout-2.3.0',
        'jquery': '../lib/jquery/jquery-1.9.1',
        'kendo': "../lib/kendo/js/kendo.web.min",
        "kendobindings": "../lib/knockout/knockout-kendo.min"
    },
    shim: {
        'jquery': {
            exports: '$'
        },
        "kendo": {
            deps: ["jquery"]
        },
        "kendobindings": {
            deps: ["jquery", "kendo", "knockout"]
        }
    }
});



No comments:

Post a Comment