Binding a property to application controller
Binding a property to application controller when the instance of application controller is not created
HTML
<script src="https://raw.github.com/wycats/handlebars.js/1.0.rc.2/dist/handlebars.js"></script>
<script src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-pre.4.js"></script>
<div id='dvMyApp'></div>
<script type='text/x-handlebars' data-template-name='sample'>
{{name}}
</script>
JavaScript
MyApp = Em.Application.create({
rootElement: '#dvMyApp'
});
MyApp.ApplicationController = Em.Controller.extend({
userName: 'hohenhiem'
});
MyApp.SampleController = Em.Controller.extend({
nameBinding: 'application.userName'
});
MyApp.SampleView = Em.View.extend({
templateName: 'sample'
});
MyApp.Router.map(function(){
this.route('sample',{path: '/'});
});