You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is the place to ask questions but...
I've been working through the anatomy of backbone and I'm a little confused about why, in your Todo app, you're listening to the 'remove' event within the TodoItems collection and then calling hideModel which in turn triggers a 'hide' event on the model in question at which point you remove the views el from the dom.
Did you do it that way just to demonstrate custom events or is it wrong (architecturally) to instead listen to the 'remove' event directly in the TodoView rather than going via the collection?
Cheers,
Rich
The text was updated successfully, but these errors were encountered:
Hi Rich,
I'll take a stab at this :) , I think the reason you would do this is so that you could have this hide event listener in one spot and have the hide functionality work across the different list views this collection might be used in. It's certainly not a bad thing to do it on a per view basis, and you may have to do that depending on what you're doing in the project.
I'm not sure if this is the place to ask questions but...
I've been working through the anatomy of backbone and I'm a little confused about why, in your Todo app, you're listening to the 'remove' event within the
TodoItems
collection and then callinghideModel
which in turn triggers a 'hide' event on the model in question at which point you remove the views el from the dom.Did you do it that way just to demonstrate custom events or is it wrong (architecturally) to instead listen to the 'remove' event directly in the
TodoView
rather than going via the collection?Cheers,
Rich
The text was updated successfully, but these errors were encountered: