client/app/gallery/gallery_controller.js
author cavaliet
Mon, 06 Oct 2014 17:36:47 +0200
changeset 7 e70f1c4785f3
parent 5 c6ff29914983
child 10 75189d83f849
permissions -rw-r--r--
search with new results

(function(){
  'use strict';

  angular.module('ammicoGallery',['ngResource', 'ngRoute'])
    .config(function ($routeProvider) {
      $routeProvider
        .when('/', {
          templateUrl: 'gallery/gallery.html',
          controller: 'galleryCtrl'
        });
    })
    .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);
              }
          }
      };
    });

})();