6. Learn backbone.js tutorial from scratch for beginners(Part 9) Pass Model data to backbone.js View

C:\Users\Administrator\Desktop\gulp\app.js
jQuery(document).ready(function($) {
var FirstModel = Backbone.Model.extend({
initialize: function() {
console.log('Hello, i am here');
}
});
var ModelView = Backbone.View.extend({
initialize: function() {
this.render();
},
render: function() {
console.log(this.model.toJSON());
}
});
fmodel = new FirstModel();
fmodel.set({
name: "Lionel 1",
author: "Lionel 2",
anchor: "Lionel 3"
});
vmodel = new ModelView({
model: fmodel
});
});
Previous5. Learn backbone.js tutorial from scratch for beginners(Part 8) Introduction of models in backbone.Next7. Learn backbone.js tutorial from scratch for beginners(Part 10) Model data to underscore.js templ
Last updated
Was this helpful?