简单的灰烬路线不起作用?

时间:2014-05-28 17:55:47

标签: javascript ember.js

不确定为什么我无法显示编辑页面...这是准确的准分子?

我有:

App = Ember.Application.create();

App.Router.map(function(){

  this.route('bank-account.edit', { path: '/bank-account/edit' });
});

模板:

  <script type="text/x-handlebars">
  <h1>App</h1>

  {{#link-to 'bank-account.edit'}}Bank account edit{{/link-to}}
  {{outlet}}
  </script>


  <script type="text/x-handlebars" data-template-name="bank-account.edit">
  <h3>Edit</h3>
  Where am I??
  </script>

这是jsbin http://emberjs.jsbin.com/cetaxe/2/edit?html,js,output

1 个答案:

答案 0 :(得分:1)

期间需要在模板名称

中转换为/
<script type="text/x-handlebars" data-template-name="bank-account/edit">
  <h3>Edit</h3>
  Where am I??
</script>

http://emberjs.jsbin.com/dagekazo/1/edit