从Ember JS中的嵌套路径渲染模板

时间:2016-01-30 14:55:43

标签: javascript ember.js

我正在尝试使用{{outlet}}标记从嵌套路线渲染模板。我似乎无法想到我可能做错了什么。

Router.js

import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('support', function() {
    this.route('terms');
  });
});

export default Router;

support.hbs

<div class="container mtx pbxl of-auto">
  <div class="col-s-3">
    <ul class="list pan mtn">
      <li class="db mbs f5">{{#link-to 'support' class="light-blue link"}}Terms of Service{{/link-to}}</li>
      <li class="db mbs f5 light-blue">Upcoming Features</li>
      <li class="db mbs f5 light-blue">Contact Us</li>
      <li class="db mbs f5 light-blue">Support</li>
    </ul>
  </div>
  <div class="col-s-7">
    {{outlet}}
  </div>
</div>

terms.hbs

<div class="db light-blue lh-copy">
Donec at orci vel erat lobortis mollis. Sed et velit leo. In rutrum dictum elit in venenatis. Aenean suscipit ut ex non luctus. Integer feugiat purus quis nibh egestas tincidunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In hac habitasse platea dictumst.
</div>

据我所知,这些是3个难题。 support.hbs模板渲染正常,但插座不是render.hbs模板。

知道我可能做错了吗?

0 个答案:

没有答案