Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var App = Backbone.View.extend({
- el: "body",
- initialize: function () {
- this.router = new Router(this);
- this.router.start();
- }
- });
- var Router = Backbone.Router.extend({
- initialize: function (app) {
- this.app = app;
- this.module = new Module();
- },
- start: function () {
- this.app.$el.html(this.module.render().$el);
- }
- });
- var Module = Backbone.View.extend({
- template: jst["module.hbs"],
- initialize: function (options) {
- this.section = new Section();
- },
- render: function () {
- this.$el.html(this.template({ value: this.section.render().$el }));
- return this;
- }
- });
- var Section = Backbone.View.extend({
- template: jst["section.hbs"],
- render: function () {
- this.$el.html(this.template({ value: "Some val" }));
- return this;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement