var book = Backbone.Model.extend({
defaults : { //--- model default values
"title" : " JavaScript- The Good Parts",
"author" : "Douglas Crockford"
},
url : \'http://myApp.lk/book\' //--- to sync data with server(CURD)
});
var shell = Backbone.View.extend({
el : $(\'#myDiv\'), //-- මෙම view එකට අදාල DOM කොටස
model : book, //-- or collection : names (List එකක් නම්)
render :function(){ // DOM වෙනස් කරන function එක
this.$el.html(this.model.get(\'name\'));
},
setPages : function(){
this.$el.append(this.model.get(\'pages\'));
}
});