I've got a function using an API that redirects me to a callback URL. I then want to execute a function in my base javascript. I'm able to use window.opener to execute the function as long as I keep the function in a separate, non-angular, JS script. However, when I try to execute an angular function I just get an undefined error.
For clarity, here's 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 what doesn't work:
callbackpage.html:
window.opener.$scope.inviteCallback();
controller.js
.controller('MainCTRL', function($scope) {
var inviteCallback = function() {
console.log('Hey Im working')
};}
I'm using facebook connect using the Requests API.