= new Products; }, render: function () { var list = new ProductList({ collection: this.collection }); this.$el.append(list.render().el); return this; } });
= new Products; }, render: function () { var list = new ProductList({ collection: this.collection }); this.$el.append(list.render().el); return this; } }); $(function () { new ProductApp().render() })
product }); this.$el.append(item.render().el); }, newProduct: function (evt) { evt.preventDefault(); var product = new Product; product.on("sync", function (model) { this.collection.add(model); }, this); var form = new ProductForm({ model: product }); form.show(); }