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

Basic readme example not cleaning up stuff? #39

Closed
alessioalex opened this issue Apr 7, 2015 · 1 comment · Fixed by #40
Closed

Basic readme example not cleaning up stuff? #39

alessioalex opened this issue Apr 7, 2015 · 1 comment · Fixed by #40
Assignees

Comments

@alessioalex
Copy link

    home: function () {
        this.trigger('newPage', new HomePage());
    },

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.

@lukekarrys
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants