Closed alessioalex closed 9 years ago
I think incorporating ampersand-view-switcher
code into the readme example is a little outside the scope of the router's documentation, since it would also require us to show the code for a view to instantiate the view-switcher.
I do think the example should be updated. I'm thinking we should put a note in there, about using app.trigger
like we do in the ampersand cli generated app's router and main view.
I'll work on getting a PR with the updated example.
This means that whenever you go to the homepage it will create a new instance of
HomePage
and probably bind some events. That code suggests that the events don't get cleaned up.I think it's better to update the example to either store the last view and then cleanup or to use the ampersand-view-switcher.