Add image creation and suppression
This commit is contained in:
parent
664cddd4fa
commit
2856a776db
9 changed files with 107 additions and 47 deletions
|
@ -22,13 +22,29 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', '$roo
|
|||
}
|
||||
}
|
||||
|
||||
// Manager logout event
|
||||
$scope.$on('updateImageEvent', function () {
|
||||
// If user is login try to retrieve data
|
||||
if (Identity.isAlreadyLogin()) {
|
||||
Loading.start();
|
||||
Image.getImages(callMeAfterGetImage);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.edit = function (image) {
|
||||
$rootScope.$broadcast("editImageEvent", image, Image.getData().axioms);
|
||||
|
||||
}
|
||||
|
||||
$scope.showUploadImageModal = function () {
|
||||
$rootScope.$broadcast("showUploadImageModalEvent");
|
||||
$scope.showCreateImageModal = function () {
|
||||
$rootScope.$broadcast("showCreateImageModalEvent");
|
||||
|
||||
};
|
||||
|
||||
$scope.deleteImage = function (id) {
|
||||
Image.deleteImage(id, function () {
|
||||
$rootScope.$broadcast("updateImageEvent");
|
||||
|
||||
})
|
||||
}
|
||||
}]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue