In my directive:
angular.module('myPopUp',[])
.directive('myPopUp',['$document', function($document){
return{
restrict: 'EA',
controller: function($scope){
},
scope: {
},
templateUrl: 'popup.html',
link: function(scope, elm, attr){
var topPosition = top + (btnHeight/2) - (popOverHeight/2);
}
After doing the calculation in link, how can I pass 'topPosition' to my popup.html template? Any ideas?
I try to do in this way, but it doesn't work.
popup.html:
<div class="popover right" style="width:auto;top:{{topPosition}}px;">
<div class="arrow"></div>
<div>.......</div>
</div>