Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular
- .module('awards.behavior-tracking')
- .controller('BehaviorTrackingIndexCtrl', BehaviorTrackingIndexCtrl)
- .$inject = ['$scope', 'BehaviorTrackingIndexService', 'PreferenceService', 'ClientService', '$stateParams'];
- function BehaviorTrackingIndexCtrl ($scope, BehaviorTrackingIndexService, PreferenceService, ClientService, $state) {
- var vm = this;
- vm.service = BehaviorTrackingIndexService;
- vm.service.repository.waitOnParams = true;
- vm.activateCtrl = function(){
- vm.init();
- };
- vm.applyFilters = function() {
- vm.service.resourceFilters = {
- 'filter': [ {
- 'field': 'behavior',
- 'type': 'eq',
- 'value': $state.params.id
- }]
- };
- vm.service.repository.params = vm.service.resourceFilters;
- };
- $scope.$watch(function() {return $state.params.id}, function(newVal, oldVal){
- vm.applyFilters();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement