ember.js - Child route not rendering on Ember -
i messing here, have child route called 'details' want render. keep getting error messages 'details' not exist.
here's router map:
import ember 'ember'; import config './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'); } ); }); the link details route:
<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"> .... todo/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> todo/details.js:
export default ember.route.extend({ rendertemplate: function() { this.render('comments', { into: 'details', outlet: 'comments' }); } }); todo.js
import ember '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', }); i tried adding
this.render('todos.details', { into: 'todos', outlet: 'todos.details' }); to todo.js, not work.
if point me in right direction i'd appreciate it.
Comments
Post a Comment