Angular: Empty Fiddle

http://angularjs.org/

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="http://fancyapps.com/fancybox/source/jquery.fancybox.css">
<div ng-controller="MyCtrl">
    Hello, {{ templateVariable }}!
    
    <script type="text/ng-template" id="testTemplate.html">
        <h1>{{ templateVariable }}</h1>
        <p>Bla bla bla</p>
    </script>
    
    <br /><br />
    <a href="#" showTemplate>Show template</a>
</div>

JavaScript

var myApp = angular.module('myApp',[]);

myApp.directive('showTemplate', function($templateCache, $compile, $parse) {
    return {
        restrict: 'A',
        link: function (scope, element, attrs, ctrl) {
            element.bind('click', function() {
                var template = $templateCache.get('testTemplate.html');
                var compiled = $compile(template)(scope);
                $.fancybox.open(template);
            });
        }
    };
});

myApp.controller('MyCtrl', function($scope) {
    $scope.templateVariable = 'My template variable';
});