How do I initialize a Kendo.observable in a modular Backbone application that uses Require.JS? This is all new to me and it feels like swimming in mud.
My MAIN.JS file looks like this:
require.config({
paths: {
jquery: 'libs/jquery/jquery-min',
underscore: 'libs/underscore/underscore-min',
backbone: 'libs/backbone/backbone-optamd3-min',
kendo: 'libs/kendo/kendo.web.min',
text: 'libs/require/text',
templates: '../templates'
},
shim: {
kendo: {
deps: ["jquery"],
exports: "kendo"
},
}
});
require([ 'kendo', 'app' ], function(kendo, App){
App.initialize();
});
And in one of my views I'm trying to create a Kendow.observable:-
define([
'jquery',
'underscore',
'backbone',
'kendo',
'text!templates/newUser.html',
], function($, _, Backbone, kendo, newUserTemplate){
var newUserView = Backbone.View.extend({
...
var viewModel = kendo.observable({
...
Do I need to shim Kendo? I've got AMD versions of jQuery, Underscore and Backbone, so I don't think I need to shim these.
Do I need to define kendo.observable in the view? If so what should the definition look like?
And how do I instantiate Kendo controls?
Thanks - I'd really appreciate any help I can get with this.