I have a function using an API that redirects me to a callback URL. Then I want to execute the function in basic javascript. I can use window.opener to execute the function while I save this function in a separate, not angular, JS script. However, when I try to execute the angular function, I just get an undefined error.
For clarity, here what works :
callbackpage.html:
window.opener.inviteCallback();
index.html
<script>
function inviteCallback() {
console.log('Hey Im working')
};
</script>
... then onto some angular code
And now that does not work :
callbackpage.html:
window.opener.$scope.inviteCallback();
controller.js
.controller('MainCTRL', function($scope) {
var inviteCallback = function() {
console.log('Hey Im working')
};}
I am using facebook connection using request APIs.
source
share