text: angular.module('fancyboxdemo.controllers', []).
      controller('FancyboxCtrl', function ($scope, $location, $timeout) {
  
          $scope.imagesForGallery = [];
          $scope.setApproot = function (appRoot) {
              //only change when needed.
              if ($scope.approot && appRoot === $scope.approot) {
                  return;
              }
              $scope.approot = appRoot;
              $scope.imagesForGallery = [
                  {
                      thumb: appRoot + 'images/thumb/image1.jpg',
                      small: appRoot + 'images/small/image1.jpg',
                      large: appRoot + 'images/large/image1.jpg'
                  },
                  {
                      thumb: appRoot + 'images/thumb/image2.jpg',
                      small: appRoot + 'images/small/image2.jpg',
                      large: appRoot + 'images/large/image2.jpg'
                  },
                  {
                      thumb: appRoot + 'images/thumb/image3.jpg',
                      small: appRoot + 'images/small/image3.jpg',
                      large: appRoot + 'images/large/image3.jpg'
                  },
                  {
                      thumb: appRoot + 'images/thumb/image4.jpg',
                      small: appRoot + 'images/small/image4.jpg',
                      large: appRoot + 'images/large/image4.jpg'
                  },
                  {
                      thumb: appRoot + 'images/thumb/image5.jpg',
                      small: appRoot + 'images/small/image5.jpg',
                      large: appRoot + 'images/large/image5.jpg'
                  }
              ];
          };
  
          //default
          $scope.setApproot('');
  
          $scope.setActiveImageInGallery = function (prop, img) {
              $scope[prop] = img;
              //console.log(img);
          };
          $scope.setScopeValue = function (prop, value) {
              $scope[prop] = value;
          };
  
      });
  
  
  