After following the ng-bbok tutorial, I encountered a strange issue where the code inside the link
function was not being executed. It turned out that the problem stemmed from having an empty compile
function before the link
function in the directive definition. Once I removed the empty compile
function, everything started working as expected. Why does this behavior occur? This is happening while using Angular 1.3.
{
compile: function() {},
link: function($scope, element, attributes) {
var size = attributes.gravatarSize || 80;
var hash = md5.digest_s($scope.email.from[0]);
$scope.gravatarImage = url + hash + '?size=' + size;
}
}