title: Pass TemplateRef with data to 3rd party library
body: <p>I'm using <a href="https://ng.ant.design/components/timeline/en#api" rel="nofollow noreferrer">ng-zorro-antd</a> library and I'm trying to pass a ng-template without duplicating  HTML.</p>
  <p>The component (in the url) expects TemplateRef as an Input property (nzDot).</p>
  <p>This is my ng-template:</p>
  <pre><code>&lt;ng-template #dotTemplate let-step&gt;
      &lt;div [ngSwitch]=&quot;step.status&quot;&gt;
          &lt;span *ngSwitchCase=&quot;'active'&quot; nz-icon nzType=&quot;info-circle&quot; nzTheme=&quot;outline&quot;&gt;&lt;/span&gt;
          &lt;span
              *ngSwitchCase=&quot;'error'&quot;
              nz-icon
              nzType=&quot;info-circle&quot;
              nzTheme=&quot;fill&quot;
              class=&quot;text-volcano-6&quot;
          &gt;&lt;/span&gt;
          &lt;span
              *ngSwitchCase=&quot;'onboarding'&quot;
              nz-icon
              nzType=&quot;info-circle&quot;
              nzTheme=&quot;outline&quot;
              class=&quot;text-yellow-6&quot;
          &gt;&lt;/span&gt;
          &lt;span
              *ngSwitchCase=&quot;'syncing'&quot;
              nz-icon
              nzType=&quot;sync&quot;
              nzTheme=&quot;outline&quot;
              class=&quot;text-geekblue-6&quot;
          &gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/ng-template&gt;
  </code></pre>
  <p>What I'm trying to do is basically send this step object (let-step) as variable to the outlet, but I don't see a way to do this, as this is controlled by the ngTemplateOutlet inside of the 3rd party component.</p>
  <p>Is there any smart way to do this?
  I see that I can make 4 templates and then bind to the property like this:</p>
  <pre><code>step.status === 'Active'
                              ? dotActiveTemplate
                              : step.status === 'syncing'
                              ? dotSyncingTemplate
                              : step.status === 'onboarding'
                              ? dotOnboardingTemplate
                              : dotErrorTemplate
  </code></pre>
  <p>But this solution seems bad and I would appreciate help.
  Thanks!</p>