Вызов функции на родительском контроллере , который объявлен в дочерней директиве .
Родительский контроллер HTML
<div ng-click="testFunction()"></div>
Родительский контроллер JS
$scope.testFunction = function(){
$scope.functionFromChildDirective()
}
Детская директива js
function TestDirective() {
return {
restrict: 'EA',
scope: {
},
templateUrl: '',
controller: function($scope) {
"ngInject";
$scope.functionFromChildDirective = function(){
console.log("TEST")
}
}
}
}
export default {
name: 'testDirective',
fn: TestDirective
};