client/app/slideshow/slideshow_controller.js
author rougeronj
Wed, 27 May 2015 19:02:43 +0200
changeset 99 c7c424e9eed5
parent 67 bc8fb175f4d9
child 106 cb13a9009bf5
permissions -rw-r--r--
refactor the ammicoApi service and put it into a specific module (ammicoCommon). Use factory to serve the resources

(function(){
    'use strict';

    angular.module('ammicoSlideshow',['ngResource', 'ngRoute', 'ui.bootstrap'])
    .controller('slideshowCtrl', function($scope, $routeParams, Slide, Book, Utils){
        $scope.slideshow = 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'});
    });
})();