Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

pkguid.controller.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. angular.module('app')
  2. .controller('PkGuidController', ['$scope', '$state', '$mdDialog', 'pkGuidBusiness',
  3. function($scope, $state, $mdDialog, pkGuidBusiness) {
  4. $scope.selected = [];
  5. $scope.query = {
  6. order: 'someText',
  7. limit: 5,
  8. page: 1
  9. };
  10. $scope.pkGuids = null;
  11. $scope.pkGuidsError = null;
  12. $scope.getPkGuids = function()
  13. {
  14. $scope.pkGuidsError = null;
  15. var orderBy = $scope.query.order;
  16. if (orderBy[0] == '-') {
  17. orderBy = orderBy.substr(1) + ":DESC";
  18. }
  19. else {
  20. orderBy = orderBy + ":ASC";
  21. }
  22. $scope.promise = pkGuidBusiness.getMultiple(orderBy, $scope.query.page - 1, $scope.query.limit).then(function(data)
  23. {
  24. $scope.pkGuids = data;
  25. $scope.pkGuidsError = null;
  26. }, function(error)
  27. {
  28. $scope.pkGuids = null;
  29. $scope.pkGuidsError = error;
  30. });
  31. };
  32. $scope.getPkGuids();
  33. // pkGuidBusiness.getSingleById('42').then(function(data)
  34. // {
  35. // console.log(data);
  36. // }, function(error)
  37. // {
  38. // console.error(error);
  39. // });
  40. }]);