I did not manage to get the event in parent controller. Tried lot of solutions but always get undefined
Also if I call to that function in link function and from there call to the controller it is not working (but print the object correct in the link function)
thx
Page:
<slider update-event="updateEvent(event)"></slider>
controller:
$scope.updateEvent= function(event) {
console.log(event);
}
directive template:
<ul>
<li ng-click='updateEvent(event)' ng-repeat="event in events track by $index"><li>
</ul>
directive code:
restrict: "AE",
templateUrl: "s.html",
replace: true,
scope:{
updateEvent: '&',
},
link: function (scope,element, attrs, ctrl) {
}