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
Merged

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

merged 1 commit into from
Mar 23, 2013

Conversation

schovi
Copy link
Contributor

@schovi schovi 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
Copy link
Contributor

daffl 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
Allow to pass an array index to removeAttr in Observe and Observe.List
@daffl daffl merged commit 1cb63c9 into canjs:master Mar 23, 2013
@schovi schovi deleted the observe-removeattr-array branch March 26, 2013 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants