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.

images.controller.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. angular.module('app')
  2. .controller('ImagesController', ['$scope', '$state', '$mdDialog', 'ImagesBusiness', 'luticateAuthCache', 'errorDialogMd',
  3. function($scope, $state, $mdDialog, ImagesBusiness, luticateAuthCache, errorDialogMd) {
  4. $scope.luticateAuthCache = luticateAuthCache;
  5. var promiseLoad = {
  6. id: "promiseLoad",
  7. loaderGroups: ["images"]
  8. };
  9. $scope.options = {
  10. page: 0,
  11. perPage: 30,
  12. only_mine: luticateAuthCache.getUser() != null
  13. };
  14. $scope.images = [];
  15. $scope.reload = function()
  16. {
  17. ImagesBusiness.getAll($scope.options, promiseLoad).then(function(data)
  18. {
  19. $scope.images = data;
  20. }, errorDialogMd.errorDialog);
  21. };
  22. $scope.delete = function(image_id)
  23. {
  24. ImagesBusiness.delete({image_id: image_id}, promiseLoad).then(function (data) {
  25. $scope.reload();
  26. }, errorDialogMd.errorDialog);
  27. };
  28. $scope.reload();
  29. }]);