title: Test whether an element exist using Protractor for Angular when the element is created after an http call completes
body: <p>My protractor test doesn't wait for the http call to complete and does not find the element and will fail the test. How do I make the protractor test wait for my http call to complete before looking for the element?</p>
  
  <p>template:</p>
  
  <pre><code>&lt;div *ngIf="done" class="myelement"&gt;myelement&lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>    this.http.get(url).subscribe(()=&gt; {
          this.done = true;
      })
  </code></pre>
  
  <p>protractor:</p>
  
  <pre><code>expect(element(by.className('myelement')).isPresent()).eventually.to.be.true;
  </code></pre>
  
  <p>I get the error "expected false to be true".</p>
  
  <p>If I remove <code>*ngIf="done"</code> then my test will pass, so the http call is definitely the issue</p>