I am currently working on a directive that has an isolate scope. The template of the directive includes an ng-repeat on an element, along with the following code snippet:
ng-click="selection(item)"
Within the directive's scope definition, I have specified the selection function as follows:
scope: {
selection: '&'
}
In the attribute of the directive, the selection function is invoked like this:
selection="onSelection(item)"
The controller associated with the directive looks like this:
$scope.onSelection = function(item) {
}
Although the function is being called, the item parameter is showing up as undefined. I find this perplexing, as I am also using ng-class="getClass(item)" on the same element, and it is functioning correctly.
If anyone has any insights or suggestions to offer, they would be greatly appreciated.
Thanks in advance!