-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Pass array to .unset() #45
Comments
the unset parameter probably isn't worth documenting. It's in there because it was inherited from the backbone source (that's how it does |
set('foo', {unset: true}) would also bypass the defaults. |
This was discussed some in the irc channel this week and some people are wondering if we even want .unset(). What is your use case for that? |
I wanted to set half the model to its default settings without me actually writing these default values as these are already part of the model description. Is there a different way with "set" to do this? |
Ah ok yes the required/default thing seems to be confusing people. If you set required:true and also set a default then that default will be set on model instantiation. |
Would also like to see Willing to submit a PR if nobody else is biting. |
Add ability to unset an array. Closes #45
Released in 4.5.0 |
It would be handy to be able to parse an array of keys to unset when calling unset().
this.model.unset(["prop1", "prop2"]);
Also, the docs on http://ampersandjs.com/docs#ampersand-state-set when using "unset" as option do not make clear what it actually does.
The text was updated successfully, but these errors were encountered: