12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- angular.module('app')
- .controller('PkGuidController', ['$scope', '$state', '$mdDialog', 'pkGuidBusiness',
- function($scope, $state, $mdDialog, pkGuidBusiness) {
-
- $scope.selected = [];
-
- $scope.query = {
- order: 'someText',
- limit: 5,
- page: 1
- };
-
- $scope.pkGuids = null;
- $scope.pkGuidsError = null;
-
- $scope.getPkGuids = function()
- {
- $scope.pkGuidsError = null;
- var orderBy = $scope.query.order;
- if (orderBy[0] == '-') {
- orderBy = orderBy.substr(1) + ":DESC";
- }
- else {
- orderBy = orderBy + ":ASC";
- }
- $scope.promise = pkGuidBusiness.getMultiple(orderBy, $scope.query.page - 1, $scope.query.limit).then(function(data)
- {
- $scope.pkGuids = data;
- $scope.pkGuidsError = null;
- }, function(error)
- {
- $scope.pkGuids = null;
- $scope.pkGuidsError = error;
- });
- };
-
- $scope.getPkGuids();
-
- // pkGuidBusiness.getSingleById('42').then(function(data)
- // {
- // console.log(data);
- // }, function(error)
- // {
- // console.error(error);
- // });
- }]);
|