I have seen this done before, I am trying to implement an encapsulating function, but it breaks my directive. Without the encapsulation it works. Has anyone done this before or does anyone know why it breaks the directive?
https://jsfiddle.net/ciderman/a0n9h0ar/1/
(function () {
myApp.directive('myPerfectDirective', function(){
return{
restrict: 'E',
scope: {
data: '='
},
template: '<p>my perrrrrrfeccct directivve</p>',
templateUrl: 'book-widget.html'
}
});
});