Action Handlers Not Working on View itself

前端 未结 2 1825
遥遥无期
遥遥无期 2021-01-27 11:23

Do action handlers not work directly on view instances?

Instead of attaching an action handler within the view, I want to attach it directly on the entire view itself.

相关标签:
2条回答
  • 2021-01-27 11:42

    Ok, I don't think there is a built in ember way to do that, but check this jsfiddle, it seems work as you expect: http://jsfiddle.net/xvkgk/8/

    0 讨论(0)
  • 2021-01-27 11:52

    The recommended solution is to make a custom view subclass. You can then add a click function the subclass that will handle click events automatically.

    0 讨论(0)
提交回复
热议问题