client/app/gallery/gallery_controller.js
changeset 5 c6ff29914983
parent 3 18a4c598ddee
child 10 75189d83f849
--- a/client/app/gallery/gallery_controller.js	Fri Oct 03 16:15:50 2014 +0200
+++ b/client/app/gallery/gallery_controller.js	Fri Oct 03 17:04:28 2014 +0200
@@ -12,6 +12,14 @@
     .controller('galleryCtrl', function($scope, $location, slideshowModel){
       console.log('gallery 5',$scope, $location, slideshowModel);
       $scope.gallery = slideshowModel.slideshow;
+      
+      $scope.deleteItem = function(i){
+          if(0<=i && i<$scope.gallery.images.length){
+              if(window.confirm('Êtes-vous sûr(e) de vouloir effacer cet élément ? Cette action est irrémédiable.')){
+                  $scope.gallery.images.splice(i, 1);
+              }
+          }
+      };
     });
 
 })();