import ngModule from '../module'; class Controller { constructor($scope, $http, $stateParams) { this.$stateParams = $stateParams; this.$scope = $scope; this.$http = $http; this.searchValue = ''; this.filter = {}; } onSearch() { this.$scope.$applyAsync(() => { this.$scope.treeview.refresh(); }); } exprBuilder(param, value) { switch (param) { case 'search': return {name: {like: `%${value}%`}}; } } onSelection(item, isIncluded) { item.isIncluded = isIncluded; const path = '/agency/api/ZoneIncludeds/toggleIsIncluded'; const params = {zoneFk: this.zone.id, item}; this.$http.post(path, params).then(() => { }); } } Controller.$inject = ['$scope', '$http', '$stateParams']; ngModule.component('vnZoneLocation', { template: require('./index.html'), controller: Controller, bindings: { zone: '<' }, require: { card: '^vnZoneCard' } });