Skip to content

Instantly share code, notes, and snippets.

@ijonas
Created May 10, 2012 10:40
Show Gist options
  • Save ijonas/2652363 to your computer and use it in GitHub Desktop.
Save ijonas/2652363 to your computer and use it in GitHub Desktop.
<!-- Would you specify: -->
<script type="text/x-handlebars" data-template-name="user">
{{content.name}}
<a href="#" {{action "logout" target="App.currentUserController"}}>Logout</a>
</script>
<!-- or -->
<script type="text/x-handlebars" data-template-name="user">
{{content.name}}
<a href="#" {{action "logout" target="controller"}}>Logout</a>
</script>
<!-- and calling the view using -->
<script type="text/x-handlebars">
Current User: {{view MyApp.UserView
contentBinding="MyApp.currentUserController.user", controllerBinding="MyApp.currentUserController"}}
</script>
<!-- which you could take a step further then and anchor the subview at the controller level.... -->
<script type="text/x-handlebars" data-template-name="user">
{{controller.user.name}}
<a href="#" {{action "logout" target="controller"}}>Logout</a>
</script>
<script type="text/x-handlebars">
Current User: {{view MyApp.UserView
controllerBinding="MyApp.currentUserController"}}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment