(function(){
    'use strict';

    angular.module('ammicoSlideshow',['ngResource', 'ngRoute', 'ui.bootstrap', 'ngTouch'])
    .controller('slideshowCtrl', function($scope, $routeParams, Slide, Book, Utils){
        $scope.slides = Slide.query({idBook:$routeParams.iSlide, format:'json'}, function(data){
            data.forEach(function(slide){
               slide = Utils.sanitizeUrls(slide);
            });
        });
        $scope.book = Book.get({idBook:$routeParams.iSlide, format:'json'});
    });
})();
