Skip to content

Commit

Permalink
Step 12.14: Create PartiesSort component
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kisiela authored and DAB0mB committed Dec 14, 2016
1 parent d8c88f0 commit 9214181
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions imports/ui/components/partiesSort/partiesSort.js
@@ -0,0 +1,36 @@
import angular from 'angular';
import angularMeteor from 'angular-meteor';

import template from './partiesSort.html';

class PartiesSort {
constructor($timeout) {
'ngInject';

$timeout(() => this.changed());
}

changed() {
this.onChange({
sort: {
[this.property]: parseInt(this.order)
}
});
}
}

const name = 'partiesSort';

// create a module
export default angular.module(name, [
angularMeteor
]).component(name, {
template,
bindings: {
onChange: '&',
property: '@',
order: '@'
},
controllerAs: name,
controller: PartiesSort
});

0 comments on commit 9214181

Please sign in to comment.