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 Dotan Simha committed Nov 22, 2016
1 parent 976d258 commit 92d0584
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions imports/ui/components/partiesSort/partiesSort.js
@@ -0,0 +1,34 @@
import angular from 'angular';
import angularMeteor from 'angular-meteor';

import template from './partiesSort.html';

class PartiesSort {
constructor() {
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 92d0584

Please sign in to comment.