Created
May 10, 2012 10:40
-
-
Save ijonas/2652363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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