ハンドルバー条件内に表示するインライン テンプレートを使用してビューを取得しようとしています。私のアプリケーション コードでは、別のルートに移動してから再び戻ると表示されます。フィドルでは、ビューに関するエラーが発生します。
<script type="text/x-handlebars" data-template-name="application">
<h1>If you click that button, I might say 'Hello!'</h1>
<button {{action 'click_me'}}>Click me</button>
{{#if controller.new_visible}}
{{#view App.MyView}}
Hello! {{/view}}
{{/if}}
</script>
var App = Ember.Application.create();
App.MyView = Ember.View.extend({});
App.ApplicationController = Ember.Controller.extend({
new_visible: false,
actions: {
click_me: function() {
alert('You clicked me!');
this.set('new_visible',true);
}
}
});
App.ApplicationView = Ember.View.extend({
templateName: 'application'
});
App.Router = Ember.Router.extend({
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/'
})
})
});
私は何を間違っていますか?