UNPKG

backbone-view-switcher

Version:
14 lines (12 loc) 354 B
var Backbone = require('backbone'); var $ = require('jquery'); Backbone.$ = $; module.exports = Backbone.View.extend({ initialize: function () { this.collection.add({kind: 'pistachio pistachio', id: 1}); }, render: function () { var model = this.collection.get(1) this.$el.html('we like ' + model.get('kind') + ' ice cream!'); } });