(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);
}
}
};
});
})();