I have a directive, here is the code :
.directive(\'map\', function() {
return {
restrict: \'E\',
replace: true,
template: \'<
You can specify a DOM attribute that can be used to allow the directive to define a function on the parent scope. The parent scope can then call this method like any other. Here's a plunker. And below is the relevant code.
clearfn is an attribute on the directive element into which the parent scope can pass a scope property which the directive can then set to a function that accomplish's the desired behavior.
Call method on directive