Ember.jsの主な機能をテストしています。提供されているガイドによると、次のコードは、単にバインディングと自動更新テンプレートを使用して出力する必要がありますHey there! This is My Ember.js Test Application!
が、代わりにを出力しますHey there! This is !
。
JS:
// Create the application.
var Application = Ember.Application.create();
// Define the application constants.
Application.Constants = Ember.Object.extend({
name: 'My Ember.js Test Application'
});
// Create the application controller.
Application.ApplicationController = Ember.Controller.extend();
// Create the application view.
Application.ApplicationView = Ember.View.extend({
templateName: 'application',
nameBinding: 'Application.Constants.name'
});
// Create the router.
Application.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/'
})
})
})
// Initialize the application.
Application.initialize();
HBS:
<script type="text/x-handlebars" data-template-name="application">
<h1>Hey there! This is <b>{{name}}</b>!</h1>
</script>
私が間違っていることはありますか?