I got quite confused about the context of the template, see the code below
<script type="text/x-handlebars">
<div>
<h1>hello world</h1>
{{view 'temp'}}
{{render 'temp'}}
</div>
</script>
var App = Ember.Application.create({
LOG_TRANSITIONS: true
});
App.ApplicationController = Ember.Controller.extend({
age: 13,
});
App.TempController = Ember.Controller.extend({
age: 14,
});
App.TempView = Ember.View.extend({
age: 123,
template: Ember.Handlebars.compile('<div>{{age}}</div>')
});
For {{view 'temp'}}, it renders 13 since the view it use the application controller as its scope/context. For {{render 'temp'}}, from what my understanding, it will use TempView and TempController as its context. however, it renders nothing. Both 14 and 123 will not render. How it can render the age that assign to the view??