JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="directives" ng-controller="Ctrl">
<my-dir prop="foo" func="bar(someValue)"></my-dir>
</div>
JavaScript
var app = angular.module('directives', []);
app.directive('myDir', function() {
return {
restrict: 'E',
template: '<div ng-click="parentFunc(someValue)"><div>',
scope: {
parentProp: '=property',
parentFunc: '&func'
},
link: function(scope, element, attrs) {
scope.parentFunc({someValue:'testing'});
}
}
});
function Ctrl($scope){
$scope.foo = 'test';
$scope.bar = function (value) {
console.log(value);
};
}