'use strict';

define(['app'], function(app) {
	app.controller('AboutCtrl', ['$http', '$scope',
        function($http, $scope) {
        
            $scope.carousel = [];

            $http({
                method: 'GET', 
                url: globals.RootPath + '/about.json'
            })

            .success(function(res, status){               
                if (status !== 200) return false;

                $scope.about = res.data;
                // console.log($scope.about);
                var gallery = $scope.about.gallery

                for (var i=0; i<gallery.length; i++) {
                    var image = gallery[i];
                    $scope.carousel.push(image);
                }
               
               $scope.image = gallery[0];

                // setTimeout(function(){
                //     $('.dcSlider').bxSlider({
                //         auto: true
                //     });
                // }, 100);
            })

            .error(function(res, status){
                console.log('error status: ' + status);
                console.debug(res);
            });

            


        
	}]);
});