Gravatar Addon error


#1

I’m getting an error in:

.directive(‘gravatarSrc’, [
‘Gravatar’,
function(Gravatar) {
return {
restrict: ‘A’,
link: function(scope, element, attrs) {
var watchVal = attrs[‘gravatarSrc’];
var watchSize = parseInt(attrs[‘gravatarSize’]) || 80;
scope.$watch(watchVal, function(val) {
element.attr(‘src’, Gravatar.get(val, watchSize));
});
}
};
}]);

scope.$watch(watchVal, function(val) { throws an exception because watchVal contains the @ character from the email address which is set via gravatar-src.

Any thoughts welcome.

Many thanks.