Comments (6)
Right, the inconsistency is definitely not good. If an entire nested object is unset, do you think each attribute needs to show up in the changedAttributes
, or just the top-level one? What about when something is removed from an array? Not obvious how those would be reflected...
Anyway, created a new branch (missing-changedattrs) with your test.
from backbone-nested.
For every change, including unset, I think it's useful to have all attributes in the affected branch (every level), reflected in changedAttributes
, not just the top-level one.
For item removal from an array, I guess I would do the same. I'm not sure if the removed array item would also show up in changedAttributes
- I would follow whatever Backbone.js does for an ordinary removed attribute.
from backbone-nested.
Well, the difference is when a property is unset()
from an object, it can appear in changedAttributes
as undefined
(see the Backbone test)... when remove()
is called on an array, I can't think of a good way for it to show up there, since that index will now have whatever element was next.
I'll work on resolving the inconsistency, though.
from backbone-nested.
Hi.
Really appriciate your work with NestedModel.
Just wanted to check if this is somthing that you're working atm on since the tests are failing? :-) Or is there something that I can do to help?
from backbone-nested.
@borestad haven't gotten a chance to tackle it. if you want to give it a shot - which would be much appreciated - just post here and send a pull request. otherwise, will get to it asap.
from backbone-nested.
Fixed by #48.
from backbone-nested.
Related Issues (20)
- Cannot set property of nested array by index dynamically HOT 3
- using Backbone.NestedModel with Backbone.RelationalModel HOT 1
- Using _.union to combine arrays alters arrays with non unique values
- change event not triggered when setting an object that contains an array HOT 4
- Set() with complex JSON overwrites rather than updating nested attributes
- model.clear() does not work when model is invalid HOT 2
- Use lodash.get for getting a property (requires a change in notation) HOT 1
- Better support for model.save with partial setting of nested attributes
- Changing nested array variables does not set 'changedAttributes'
- seems like none of your github pages are working HOT 2
- The plugin should return the NestedModel object instead of Backbone. (CommonJS, AMD) HOT 2
- Running Grunt default task produces error when it runs QUnit task
- change event fires on nested parents while there is no actual change on the deep chiled
- Typo in README? HOT 2
- Use `_.extend` instead of `$.extend` HOT 3
- looking for maintainters
- "Backbone.Model - `previous` for falsey keys" test failing
- _runDelayedTriggers performance issue HOT 1
- _setAttr function performance issue for large dataset
- Need a small change to be compatible with latest lodash (and still be backward compatible)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone-nested.