|
0
|
1 |
(function(){ |
|
|
2 |
'use strict'; |
|
|
3 |
|
|
|
4 |
angular.module('ammicoGallery',['ngResource', 'ngRoute']) |
|
|
5 |
.config(function ($routeProvider) { |
|
|
6 |
$routeProvider |
|
|
7 |
.when('/', { |
|
|
8 |
templateUrl: 'gallery/gallery.html', |
|
|
9 |
controller: 'galleryCtrl' |
|
|
10 |
}); |
|
|
11 |
}) |
|
3
|
12 |
.controller('galleryCtrl', function($scope, $location, slideshowModel){ |
|
|
13 |
console.log('gallery 5',$scope, $location, slideshowModel); |
|
|
14 |
$scope.gallery = slideshowModel.slideshow; |
|
5
|
15 |
|
|
|
16 |
$scope.deleteItem = function(i){ |
|
|
17 |
if(0<=i && i<$scope.gallery.images.length){ |
|
|
18 |
if(window.confirm('Êtes-vous sûr(e) de vouloir effacer cet élément ? Cette action est irrémédiable.')){ |
|
|
19 |
$scope.gallery.images.splice(i, 1); |
|
|
20 |
} |
|
|
21 |
} |
|
|
22 |
}; |
|
0
|
23 |
}); |
|
|
24 |
|
|
|
25 |
})(); |