Skip to content

glibin/backbone-template-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Template loader for Backbone JS

This loader used to make easier to handle templates in Backbone (lazy loading, caching, etc.).

Example page available at http://glibin.github.com/backbone-template-loader

Usage

window.AppView = Core.View.extend({
    el: $("#app"),

    // Url to template
    templateUrl: '/templates/app.html',

    initialize: function() {
      AppView.__super__.initialize.apply(this); // Call parent initializator

      ...
    },
    // You should rename render function to _render
    _render: function() {
      // Render here, template available in this.template variable (this.template(model))
      this.$('.container').html(this.template({...}));
    },

    ...

});

About

Load backbone templates from url

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published