title: How to postpone processing in ng-template until it's created?
body: <p>I have a modal component that I build which is pretty simple and looks similar to this:</p>
  
  <pre><code>&lt;ng-template #content&gt;
      &lt;ng-content&gt;&lt;/ng-content&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p>I then dynamically create the <code>content</code> template using <code>@angular/cdk/overlay</code> when the modal is shown.</p>
  
  <p>This system has worked great for me until just recently when I had a scenario where i needed a modal tied to each item in a long list. It also so happens that within each modal I am loading a largish amount of items e.g.</p>
  
  <pre><code>&lt;my-modal&gt;
    &lt;div *ngFor="let item of lotsOfItems$ | async&gt;&lt;/div&gt;
  &lt;/my-modal&gt;
  </code></pre>
  
  <p>I had assumed that since <code>&lt;my-modal&gt;</code> content was in a template that isn't being created until it's shown that <code>lotsOfItems$</code> wouldn't be subscribed to except when a modal was shown. If I add a <code>tap(console.log)</code> to that observable though I see that it is being subscribed to for each modal tied to each item in the list which is causing a really choppy DOM experience.</p>
  
  <p>I poked around the documentation a bit and searched online, but I can't seem to find anything about how to defined and <code>&lt;ng-template&gt;</code> but not have any of the operations inside of it process until it's created.</p>
  
  <p>Is this possible?</p>