Is there a good way to have AngularJS directives evaluate an attribute passed in as a parameter?
Here's a simplified example to show my problem (I recognize you could implement this behavior without a directive):
link: function postLink(scope, element, attrs) {
debugger; // scope.$parent already knows the value of teacher here
scope.sendEmail = function(){
alert(attrs.recipient);
//window.open("mailto:" + attrs.recipient);
}
}
I would like the directive to use the value of teacher.email (note that the link function has the correct value for scope.$parent.teacher) instead of the string teacher.email.