Skip to content

[Proposal] Call the bind and unbind method in view hooks instead of route hooks/events #5

@visheshjoshi

Description

@visheshjoshi

I also wanted to suggest, doing the binding and unbinding as a part of the 'didInsertElement' hook and the 'willDestroyElement' hook of Ember.view.

Reasoning:
Mousetrap relies on capturing a DOM element and acting on it. Having the bindings on activate of a route might cause this to fail sometimes in case the DOM has not been rendered yet.

Users can be suggested to override the Ember.view class in their applications main view.
The 'didInsertElement' of the applications main view will be called after all the other views have been rendered.

Let me know what you feel about that. If you agree, I can send a PR with the required changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions