title: Using window opener for a function in AngularJS
body: <p>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.</p>
  
  <p>For clarity, here's what <strong>works</strong>:</p>
  
  <p>callbackpage.html:</p>
  
  <pre><code>window.opener.inviteCallback();
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;script&gt;
          function inviteCallback() {
              console.log('Hey Im working')
          };
      &lt;/script&gt;
  ... then onto some angular code
  </code></pre>
  
  <p>And now what <strong>doesn't work</strong>:</p>
  
  <p>callbackpage.html:</p>
  
  <pre><code>window.opener.$scope.inviteCallback();
  </code></pre>
  
  <p>controller.js</p>
  
  <pre><code>.controller('MainCTRL', function($scope) {
      var inviteCallback = function() {
              console.log('Hey Im working')
          };}
  </code></pre>
  
  <p>I'm using facebook connect using the Requests API.</p>