我显然在这里乱搞一些东西,但我有一条名为'详细信息的儿童路线。我要渲染。但是,我不断收到错误消息,其中包含详细信息和#39;不存在。
这是我的路由器地图:
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
export default Router.map(function() {
this.resource('lists', {path: '/'}, function() {
this.route('show', {path: 'lists/:list_id'} );
});
this.route('todo', {path: 'todos/:todo_id'}, function() {
this.route('details');
} );
});
指向详细信息路线的链接:
<div class="row">
{{!div class="col-xs-12 col-xs-offset-5"}}
{{!task list}}
<ul class="list-group">
{{#each todo in model.todos itemController="todo"}}
{{#link-to "todo.details" todo}}
<li class="list-group-item">
....
待办事项/ details.hbs:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<div class="container-fluid">
<div class="row">
<h3>{{todo.model.title}}</h3>
</div>
<div class="row">
<li>
<p>my name<small>timestamp</small></p>
<p class="bubble">yea</p>
</li>
</div>
{{outlet "comments"}}
</div>
待办事项/ details.js:
export default Ember.Route.extend({
renderTemplate: function() {
this.render('comments', {
into: 'details',
outlet: 'comments'
});
}
});
todo.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function(params){
// return model
},
renderTemplate: function(controller) {
this.render('lists.show', {controller: controller});
// this.render('todos', {controller: 'todo'});
this.render('todos', {
into: 'lists.show',
outlet: 'todos',
});
我尝试添加
this.render('todos.details', {
into: 'todos',
outlet: 'todos.details'
});
到todo.js,但它不起作用。
如果你能指出我正确的方向,我会很感激。