/*
	angular-photoswipe v0.0.3
	(c) 2015 Massimiliano Sartoretto <massimilianosartoretto@gmail.com>
	License: MIT
*/

'format amd';
/* global define */

(function () {
  'use strict';

  function ngPhotoswipe(angular, Photoswipe) {

    return angular
      .module('ngPhotoswipe', [])
      .directive('ngPhotoswipe', ngPhotoswipeDirective);

    ngPhotoswipeDirective.$inject = ['$compile','$http','$templateCache'];

    function ngPhotoswipeDirective($compile, $http, $templateCache) {
      return {
        restrict: 'AE',
        replace: true,
        scope: {
          slides: '=',
          options: '='
        },
        link: linkFn,
        controllerAs: 'vm',
        bindToController: true
      };
    }

    function linkFn(scope, iElement, iAttrs, vm) {
      $http
        .get('../../ng-photoswipe.html', { cache: $templateCache })
        .success(function(html) {
          var template = angular.element(html);
          iElement.append($compile(template)(scope));
        });

      scope.start = function(){
        var pswpElement = document.querySelectorAll('.pswp')[0];
        var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default || false, scope.slides, scope.options);
        gallery.init();
      };
    }
  }

  if (typeof define === 'function' && define.amd) {
		define(['angular', 'Photoswipe'], ngPhotoswipe);
	} else if (typeof module !== 'undefined' && module && module.exports) {
		ngPhotoswipe(angular, require('Photoswipe'));
		module.exports = 'ngPhotoswipe';
	} else {
		ngPhotoswipe(angular, (typeof global !== 'undefined' ? global : window).Photoswipe);
	}
})();

@@ -712,15 +712,11 @@
  %7D;%0A
+%0A
   
-  %7D%0A%0A
     
@@ -758,12 +758,8 @@
 ttrs
-, vm
 ) %7B%0A
@@ -768,14 +768,18 @@
     
+  
 $http%0A
+  
     
@@ -850,16 +850,18 @@
         
+ 
+ 
 .success
@@ -874,24 +874,26 @@
 ion(html) %7B%0A
+  
           va
@@ -928,16 +928,18 @@
 (html);%0A
+  
         
@@ -996,13 +996,17 @@
     
+  
 %7D);%0A%0A
+  
     
@@ -1037,24 +1037,26 @@
 ()%7B%0A        
+ 
+ 
 var pswpElem
@@ -1100,16 +1100,18 @@
 p')%5B0%5D;%0A
+  
         
@@ -1213,16 +1213,18 @@
 tions);%0A
+  
         
@@ -1245,18 +1245,28 @@
 ;%0A      
+  %7D;%0A      
 %7D
-;
 %0A    %7D%0A 

Move link definition inside directive block