Skip to content
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

Allow to pass an array index to removeAttr in Observe and Observe.List #325

Merged
merged 1 commit into from Mar 23, 2013

Conversation

Projects
None yet
2 participants
@schovi
Copy link
Contributor

commented Mar 20, 2013

With this you can pass arrays into removeAttr method

o = new can.Observe({array:[{nested: "yes we can!"}]})
o.bind('change', fuction(ev, prop, type, newVal, oldVal) {console.log(arguments)})
o.removeAttr('array.0.nested') // -> "yes we can!"
// Event trigger arguments [{event object}, "array.0.nested", "remove", undefined, "yes we can!"]
o.attr('array.0.nested') // -> undefined

Fiddle with current state where this will throw an error http://jsfiddle.net/2a8TW/

@daffl

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2013

👍 Thanks! That looks good. I think this can go into 1.1.5 for Sunday.

daffl added a commit that referenced this pull request Mar 23, 2013

Merge pull request #325 from schovi/observe-removeattr-array
Allow to pass an array index to removeAttr in Observe and Observe.List

@daffl daffl merged commit 1cb63c9 into canjs:master Mar 23, 2013

1 check passed

default The Travis build passed
Details

@schovi schovi deleted the schovi:observe-removeattr-array branch Mar 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.