Skip to content

Commit 3743905

Browse files
committed
Replace setupController for injection+computed.alias
This makes the relationship between the controllers more obvious.
1 parent 4a29110 commit 3743905

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

app/controllers/category/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export default Ember.Controller.extend(PaginationMixin, {
1111

1212
totalItems: computed.readOnly('model.meta.total'),
1313

14+
categoryController: Ember.inject.controller('category'),
15+
category: computed.alias('categoryController.model'),
16+
1417
currentSortBy: computed('sort', function() {
1518
return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical';
1619
}),

app/routes/category/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,5 @@ export default Ember.Route.extend({
99
model(params) {
1010
params.category = this.paramsFor('category').category_id;
1111
return this.store.query('crate', params);
12-
},
13-
14-
setupController(controller, model) {
15-
controller.set('category', this.modelFor('category'));
16-
this._super(controller, model);
17-
},
12+
}
1813
});

0 commit comments

Comments
 (0)