kahwee / backbone-deep-model

Improved support for models with nested attributes.
MIT License
73 stars 24 forks source link

Index notation could use [] #2

Open stevenpetryk opened 9 years ago

stevenpetryk commented 9 years ago

From the README:

model.get('otherSpies.0.name')

Wouldn't it make more sense to have the option to write

model.get('otherSpies[0].name')

since that's how the parameter would be referenced in JS?

kahwee commented 9 years ago

Hey, sorry for not replying this soon enough. I think this does make sense. However this will make things backward incompatible. I still can't decide at this stage if this is a good idea.

stevenpetryk commented 9 years ago

Both syntaxes could be supported. I'll see if I can throw together a pull request by Friday.