title: AngularJS window.close not working
body: <p>I'm having trouble calling the <code>window.close</code> function, without getting the following error:</p>
  
  <blockquote>
    <p>Scripts may close only the windows that were opened by it. </p>
  </blockquote>
  
  <p>Here is how I have my app laid out:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;html ng-app="mynewAPP" ng-controller="appCTRL"&gt;
  
  ....blahblah &lt;/html&gt;
  </code></pre>
  
  <p>My Angular controls work fine, but when I call <code>window.close</code>, it is not working (at least the closing part... rest of app is fine).</p>
  
  <pre><code>app.controller("appCTRL" ,function( [injections]){
    $window.close();
  }
  </code></pre>
  
  <p>How would I go about allowing AngularJS to close the window it is sitting on?</p>
  
  <p>For example the below script would work fine: (basic JS)</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
      function closeme(){
          window.close(); 
      }
  
      &lt;/script&gt;&lt;/head&gt;
  
      &lt;body onload="closeme()"&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>For those that are wondering how I am opening the page, simply by visiting "mypage.html" on the browser. Nothing fancy.</p>