I am using the facebook authentication API v2.8 in an angularJs application mostly following the document https://blog.brunoscopelliti.com/facebook-authentication-in-your-angularjs-web-app/. I have put the authentication related code in a service. Now, i want to use the facebook login button inside a component like -
<fb:login-button scope="public_profile,email" onlogin="$ctrl.checkLoginState()">
</fb:login-button>
I intend to call the authentication service from the method $ctrl.checkLoginState defined inside my component controller, but I am getting an uncaught reference error -
sdk.js:89 Uncaught ReferenceError: $ctrl is not defined(…).
Any ideas to work around this?