return {
restrict: 'E',
templateUrl: 'client/machines/program-information/program-information.html',
controllerAs: 'programInformation',
controller: function ($scope, $stateParams, $reactive) {
$reactive(this).attach($scope);
this.perPage =7;
this.page = 1;
this.sort = {
time: -1
};
this.orderProperty = '1';
this.machineId = $stateParams.machineId;
this.subscribe('programRecords', () => {
return [
{
limit: parseInt(this.perPage),
skip: parseInt((this.getReactively('page') - 1) * this.perPage),
sort: this.getReactively('sort')
},
this.getReactively('machineId')
]
});