title: wait until Angular has finished loading issue
body: <p>I am using a similar implementation to what Salim posted here <a href="https://stackoverflow.com/questions/25062969/testing-angularjs-with-selenium/54137122#54137122">Testing AngularJS with Selenium</a> </p>
  
  <p>However, when ran, the check will systematically wait the "webdriver wait" period.</p>
  
  <p>From what I see, the boolean check will always return false, no matter what.</p>
  
  <p>Anyone has any ideas?</p>
  
  <p>I've tried to shorten the timeout value of the wait as well as changing the pooling rate, but all that did is use those new values, not really "returning true" to the check.</p>
  
  <pre><code>// Will check if Angular still has pending http_requests ongoing and wait if required
  public boolean untilAngularHasFinishedProcessing()
  {
    until(() -&gt;
      {
        final boolean hasFinishedLoading = Boolean.valueOf(((JavascriptExecutor) driver)
      .executeScript("return (window.angular !== undefined) "
        + "&amp;&amp; (angular.element(document).injector()!==undefined) "
        + "&amp;&amp;(angular.element(document).injector().get('$http')"
        + ".pendingRequests.length===0)").toString());
        log.info("Waiting on angular to finish processing =&gt; " + hasFinishedLoading);
        return hasFinishedLoading;
      }
    );
    return true;
  }
  </code></pre>
  
  <p>Expected: 
  the wait should end as soon as Angular doesn't have any pending http_requests</p>
  
  <p>Result:
  Always reach the "timeout" no matter what</p>