title: Run Angular code before page rendering with Phantom
body: <p>I have written a script to give me some information of a specific page, unfortunately I cannot get it's angular code to fully run before I render it. The code is accessing the right page, but not angular code is ran before the rendering is done from Phantom side. Here is the bit of code:</p>
  
  <pre><code>var page = new WebPage()
  var fs = require('fs');
  
  page.customHeaders = {
      'Authorization': 'Basic ' + btoa('user:pass')
  };
  page.viewportSize = {
      width: 1000,
      height: 800
  };
  page.open("https://address", function() {
      window.setTimeout(function() {
          page.render("valued.png");
          phantom.exit();
      }, 5000); // Change timeout as required to allow sufficient time});
  });
  
  page.onLoadFinished = function() {
      console.log("Page load finished");
      // page.evaluate(function() {});
      var content = page.content;
      console.log('Content: ' + content);
      phantom.exit();
  };
  </code></pre>
  
  <p>I cannot use <code>page.onCallBack</code> as I am not the author of that specific page, so I cannot call my Phantom code when the page is fully redenered. Any ideas?</p>
  
  <p>I even tried to set a bigger timeout and I can see the rendered page, but with no content loaded:</p>
  
  <pre><code>var page = new WebPage()
  
  
  page.viewportSize = {
      width: 1000,
      height: 800
  };
  
  page.customHeaders = {
      'Authorization': 'Basic ' + btoa("user:pass")
  };
  
  page.open("https://address", function() {
      window.setTimeout(function() {
          page.render("valued.png");
          phantom.exit();
      }, 10000);
  });
  </code></pre>