Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Actions specified inside the {{render}} helper appear not to reach their specified controller.
{{#render "header"}}
<header class="header-main">
<!--
* Dropping the debugger here has this.controller properly
set (<Ab.HeaderController:emberXXX>).
* this.view is null, although render.js#L57 correctly finds the object named 'view:header'
* Calling this.controller.toggleMode() from the debugger works as expected.
-->
<nav class="nav-main">
<button {{action toggleMode}}>Grid Mode</button>
</nav>
</header>
{{/render}}
{{outlet}}
# This controller doesn't manage a model.
#
Ab.HeaderController = Ember.Controller.extend
needs: ['currentUser']
toggleMode: ->
@get('controllers.currentUser').toggleProperty 'usesCompactLayout'
# For debugging purposes, I wanted to see if I could direct the action to the view,
# and then forward it, but this `toggleMode` is also not reached by the action helper.
Ab.HeaderView = Ember.View.extend()
# toggleMode: -> @get('controller').send('toggleMode', arguments...)
@arbales
Copy link
Author

arbales commented May 9, 2013

Nevermind I guess?

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