You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

articleCategory.controller.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. angular.module('app')
  2. .controller('articleCategoryController', ['$scope', '$stateParams', 'articlesBusiness', 'AppUtilsBusiness', 'luBusyBusiness',
  3. function($scope, $stateParams, articlesBusiness, AppUtilsBusiness, luBusyBusiness) {
  4. $scope.busy = luBusyBusiness.reset();
  5. $scope.items = null;
  6. $scope.appUtils = AppUtilsBusiness;
  7. $scope.itemType = $stateParams.type;
  8. $scope.query = {
  9. order: 'id',
  10. filter: '',
  11. limit: 10,
  12. page: 1
  13. };
  14. $scope.resetFilter = function()
  15. {
  16. if ($scope.query.filter != '') {
  17. $scope.query.filter = '';
  18. $scope.load();
  19. }
  20. };
  21. $scope.load = function()
  22. {
  23. articlesBusiness.getMultiple($scope.query.order, 'type: ' + $scope.itemType + ' ' + $scope.query.filter,
  24. $scope.query.page - 1, $scope.query.limit, 'articleCategory.articleCategory').then(function(data)
  25. {
  26. $scope.items = data;
  27. }, function (error) {});
  28. };
  29. $scope.load();
  30. }]);