I have a directive that handles the comments process. I'm binding it to a parent Controller, as followings:
<div commentable signin="signIn()"</div>
In the comment template I have multiple signin provider buttons; therefore I need to pass the provider back to the parent Controller. But doing this gives me undefined.
Here is the button in the directive:
<button type="button" ng-click="signin('app')">Sign In</button>
Here is the Controller function:
$scope.signIn = function (provider) {
console.log('clicked signin ' + provider);
}
How do can I bind the provider string from the ng-click to Ctrl's provider in the function?