Sha256: 5ef6fae71cab359a2801b8229141cf25d7b5144e2f1309218313ed674bf9bee5
Contents?: true
Size: 1003 Bytes
Versions: 18
Compression:
Stored size: 1003 Bytes
Contents
// Category View // ============= // Includes file dependencies define([ "jquery", "backbone","models/CategoryModel" ], function( $, Backbone, CategoryModel ) { // Extends Backbone.View var CategoryView = Backbone.View.extend( { // The View Constructor initialize: function() { // The render method is called when Category Models are added to the Collection this.collection.on( "added", this.render, this ); }, // Renders all of the Category models on the UI render: function() { // Sets the view's template property this.template = _.template( $( "script#categoryItems" ).html(), { "collection": this.collection } ); // Renders the view's template inside of the current listview element this.$el.find("ul").html(this.template); // Maintains chainability return this; } } ); // Returns the View class return CategoryView; } );
Version data entries
18 entries across 18 versions & 1 rubygems