|
'use strict';
/**
* @ngdoc function
* @name domainManagerApp.controller:AboutCtrl
* @description
* # AboutCtrl
* Controller of the domainManagerApp
*/
angular.module('goApp.slideshow', ['ngFx', 'ngAnimate', 'goApp.data'])
.controller('SlideshowController',['$scope', '$rootScope', '$famous', '$timeline', '$location', '$route', '$timeout', 'Data', function ($scope, $rootScope, $famous, $timeline, $location, $route, $timeout, Data) {
// Get Page Data
var link = $location.url()
$scope.pageData = Data.getPageData(link);
$rootScope.$on('data:loaded', function(data) {
if(!$scope.$$phase) {
$scope.$apply(function(){
$scope.pageData = Data.getPageData(link);
});
}
});
// FadeIn
$timeout(function(){
$scope.showView = true;
},100);
// FadeOut
$scope.fadeOut = function() {
$scope.showView = false;
$timeout(function(){
$location.path("/");
},500);
}
$scope.index = 0;
$scope.images = [];
for (var i = 0; i < $scope.pageData.slides.length; i++) {
$scope.images.push($scope.pageData.slides[i].url);
}
// callbacks for change in slides
$scope.updateTsPrevious = function() {
$scope.tsPrevious = +new Date();
};
$scope.updateTsNext = function() {
$scope.tsNext = +new Date();
};
}]);
|