I have a simple attribute-restricted directive like
app.directive('akMouseOver', function () {
return {
restrict: 'A',
scope: {
mouseOver: '&akMouseOver'
},
controller: function ($scope) {
},
link: function (scope, elem, attrs) {
elem.bind('mouseover', function () {
scope.mouseOver({ hValue: value });
});
}
}})
that I am calling on a simple HTML button as
<button ak-mouse-over='btnMouseOver('Win Win')' class='btn btn-primary'> Hello There !</button>
and my parent controller method is
$scope.btnMouseOver = function (hValue) {
alert(hValue + 'Hello !!!');
}
Here, somehow, I am unable to pass a parameter to the parent method. If I make this implementation without parameter, it is working and I see alert(), if I hover the mouse over the button.
Looking for passing (a) parameter/s without adding additional attribute/directive/scope variable.