#15 Merged at 5214b2c
Repository
atlassian
Branch
master
Author
  1. Christopher Mann
Reviewers
Description

Adds an option to permit .set() on an object containing attributes not defined in namedAttributes.

The goal is to decouple frontend and backend models by permitting additive changes to backend response objects.

  • Dependencies Checking for dependencies...
  • Dependents Checking for dependents...

Comments (3)

  1. Scott Harwood

    Can we just do this at a global level, so we don’t have to set the property for every model?

    So just expose a method

    var setting; 
    Brace.setup = function (options) {  
        settings = options;  
    }
    
    1. Christopher Mann author

      In terms of getting it out there without mass changes & an education campaign around it, I was thinking something like this in the shim:

          const Brace = braceFactory(_, Backbone);
          Brace.Model = Brace.Model.extend({ignoreUnknownAttributes: true});
          return Brace;
      

      Global setting felt a bit heavy handed & inflexible.