I have found a few good examples of doing this but am having trouble. I have a click function that I want to send some info to my controller from my directive. The function looks like so -
function selected(info){
scope.changeSelect = info;
console.log(info);
}
Pretty straight forward - so far this works fine, the console.log shows what i need it to show. After this point I think I have something incorrect. It looks like so.
In the top of my directive I have my scope set like so
scope: {
changeSelect: "&"
}
Then next to the html directive call inline I have this
change-select="onChange(changedVal)" >
and then in my controller I have
$scope.onChange = function(changedVal) {
$scope.myPick = changedVal;
console.log("hit");
};
This part is not getting a hit - i am not sure what I am doing wrong here and could use a second pair of eyes. Thanks!
Don't know if this helps, but gutted out the non relevant parts and dropped it into an (non working) fiddle to make this a bit more clear -