AngularJS Fancybox Popup -
i have started angularjs project , implement fancybox.
for this, have included jquery , fancybox plugins solution. attempting open template in code shown below in fancybox window.
view
<a href="" ng-click="openpage('popups/add.html')">add</a>
controller
app.controller('maincontroller', function maincontroller($scope) { $scope.user = "hey welcome"; $scope.open = function(template_path){ $.fancybox({"href":template_path}) } } )
and popup/add.html
<div class="pop-contnr"> <h2>add</h2> <table> <thead> <tr> <th align=center>{{user}}</th> </tr> </thead> </table> </div>
fancybox opens window containing template, {{user}}
expression has not been evaluated. can please help?
i have created directive fancybox
app.directive('fancybox',function($compile, $timeout){ return { link: function($scope, element, attrs) { element.fancybox({ hideonoverlayclick:false, hideoncontentclick:false, enableescapebutton:false, shownavarrows:false, oncomplete: function(){ $timeout(function(){ $compile($("#fancybox-content"))($scope); $scope.$apply(); $.fancybox.resize(); }) } }); } } });
Comments
Post a Comment