I’ve got problem with new Ember.js (1.0 pre)
I got something what worked on Ember 0.9.8 but when I changed version of this lib I noticed problem which can’t resolve. (I’m not so good at Ember :/)
Here is sample code:
http://jsfiddle.net/ETQCc/5/
I created view:
<script type="text/x-handlebars" data-template-name="MyView">
{{s}} / {{content.s}} / {{this.s}} / {{view.s}}
</script>
App.myview = Em.View.extend({
layoutName : "MyView",
});
And I’d like to show some varible which depends on what I set in content bindig:
<script type="text/x-handlebars">
xx{{view App.myview contentBinding="App.ctrl"}}
</script>
How to get to varible in this controller?
You have two ways to do that.
You can :
{{s}}works directly:{{view App.myview controllerBinding="App.ctrl"}}sproperty of the view content:{{view.content.s}}I suggest you to take a look at Ember.js View Context changes.