My models already have a defaults hash. When parts of the view/page are reset, I wish to reset the models back to their original defaults.  Currently, I explicitly set each attribute to its default value. Is there anything built in or a JavaScript/Un...
Here's the goal: I have a parent model. It is in a collection called parents. In a parent is a collection of children. So, when I instantiate the parents collection, I get the parent models, each with the collection of children in them.  I've...
The reason I'm late to the backbone party is because I'm worried it wont play nicely with my existing webservice.  I have even got to the point where I'm using my own version of backbones controllers and models, but its fruitless to just...
In my view's method below, my model gets synced with the server if I understand the create() method properly. However, the console.log of this.model.id still returns undefined and this.model.isNew() returns true. The POST shows an id in the retur...
My API response:  {   firstName: '',   lastName: '',   notifications: [     {       category: '1',       subcategory: '',       source: '',       optInDate: '',       optOutDate: '',       activ...
i'm trying to get my feet wet with Backbone, but I can't figure out what's wrong here:  var  ToDoApp = {             model: Backbone.Model.extend({                 default:function(){                     return {                         t...
I am using BackboneJS for my application. In my scenario, I have a collection (say booksCollection) with list of all the books (say model Book). I need to get a certain book based on the id and pass it to a view. I have the following code:   var book...
I just started work with backbone.js and I have some issue. Sample of code:  var Product = Backbone.Model.extend({   defaults: {     id: 0,     category: 0,     material: '',     capacity: 0,     sharpe: 0   },   initialize: function(){     c...
I have the following code, where I bind a change to a single attribute "attribute_1".   var Mine = Backbone.Model.extend({   initialize: function() {     this.bind("change:attribute_1", function() {       console.log('changed!'...
Im fairly new to backbone and running into a weird problem  I have a model that looks like so:   define( function ( require, exports, module )  {      "use strict";  var Backbone = require( 'backbone' );  return Backbone.Model.extend(...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.