Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/initializers/blanket.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function initialize(application) {
inject('settings', 'service:settings');
inject('fastboot', 'service:fastboot');
inject('routing', 'service:-routing');
inject('router', 'service:router');
inject('cookies', 'service:cookies');
inject('infinity', 'service:infinity');
application.inject('component', 'router', 'service:router');
Expand Down
15 changes: 14 additions & 1 deletion app/mixins/ember-table-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Mixin from '@ember/object/mixin';
import { getOwner } from '@ember/application';

export default Mixin.create({
queryParams : ['page', 'per_page', 'search', 'sort_dir', 'sort_by'],
Expand All @@ -7,5 +8,17 @@ export default Mixin.create({
search : null,
sort_dir : null,
sort_by : null,
sorts : []
sorts : [],

/*
Refreshes the current model, with latest data from API server without reloading
the entire page.
Requires correct context.
Usage example inside a controller:
this.refreshModel.bind(this)()
*/

refreshModel() {
getOwner(this).lookup(`route:${this.router.currentRoute.name}`).refresh();
}
});