title: Async pipe subscription not work correctly when nested inside ngIf
body: <p>I have a quick search box which I would like to have a loading animation. I used <code>ng-template</code> with <code>ngIf</code> to show/hide this animation. And I have some li's nested inside the same div which subscribed to a search result Observable using async pipe to display results. This async pipe works great when there's no <code>*ngIf</code> on the parent div, but seems it is not subscribing anymore when I apply <code>ngIf</code>. Is this an expected behavior? Or am I doing anything wrong?</p>
  
  <p>My markup looks like this.</p>
  
  <pre><code>&lt;input #searchBox type="text" (keyup)="itemLoading=true;searchTerm$.next(searchBox.value)"/&gt;
  &lt;div *ngIf="!itemLoading else loading"&gt;
  &lt;!--Remove ngIf then items will display correctly when search--&gt;
  &lt;!-- &lt;div&gt; --&gt;
    &lt;ul&gt;
      &lt;li *ngFor="let item of result$ | async "&gt;{{item}}&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  &lt;ng-template #loading&gt;
    &lt;p&gt;LOADING...&lt;/p&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p>And I am using switchMap to run the search:</p>
  
  <pre><code>private source = of(['apple', 'pear', 'banana']).pipe(delay(500));
  
    searchTerm$ = new Subject&lt;string&gt;();
    result$: Observable&lt;string[]&gt;;
    itemLoading = false;  
  
    constructor() {
      this.result$ = this.searchTerm$.pipe(
        tap(term =&gt; console.log('search term captured: ' + term)),
        debounceTime(300),
        distinctUntilChanged(),
        switchMap(() =&gt; this.source.pipe(
          tap(_ =&gt; {
              console.log('source reached');
              this.itemLoading = false;
            })
        ))
      );
    }
  </code></pre>
  
  <p>When <code>ngIf</code> is present in parent div, the 'source reached' message is never logged in console, as well as the loading template keeps hanging there.</p>
  
  <p>Here is a full working example of what I am talking about: <a href="https://stackblitz.com/edit/angular-2ukcqu" rel="noreferrer">https://stackblitz.com/edit/angular-2ukcqu</a></p>