You need to do it in the linking function. Scope is not applied till the link phase (which comes after the compile phase). Also do not create an isolated scope on the same element (removed scope: {}
) as that would mean that you would need to set scope.entry.id
within your link function. So:
app.directive("opensAsPopup", [ ->
restrict: "A"
replace: false
transclude: false
link: (scope,tElement, tAttrs) ->
new lightbox(tElement.get(0))
])