Commit 447b7850 authored by Stas SUȘCOV's avatar Stas SUȘCOV

Router now implements `connectOutlets` method.

Renders items on root path.
parent 8125e6a3
......@@ -6,7 +6,7 @@ define('app/router', [ 'ember' ],
*
* @returns Class
*/
function( ItemsView, StatsView, FiltersView, ClearBtnView ) {
function() {
return Ember.Router.extend({
enableLogging: true,
......@@ -18,6 +18,20 @@ define('app/router', [ 'ember' ],
index: Ember.Route.extend({
route: '/',
connectOutlets: function( router ) {
var controller = router.get( 'applicationController' );
var context = controller.namespace.entriesController;
require([ 'app/controllers/todos', 'app/views/items' ],
function( TodosController, ItemsView ) {
controller.connectOutlet({
viewClass: ItemsView,
controller: TodosController.create(),
context: context
});
}
);
}
}),
active: Ember.Route.extend({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment