title: Why is ng-include not in angular, and what is the new "angular way" of handling dynamic templates?
body: <p>I have been upgrading my AngularJS application to use the new Angular, and one of the things that was used extremely heavily was <code>ng-include</code>..  Situations like a modal service which allowed controllers to using the service to pass in a config that had paths to templates for the header, body, and footer of the modal:</p>
  <pre><code>&lt;ng-include src=&quot;config.header()&quot;&gt;&lt;/ng-include&gt;
  &lt;ng-include src=&quot;config.body()&quot;&gt;&lt;/ng-include&gt;
  &lt;ng-include src=&quot;config.footer()&quot;&gt;&lt;/ng-include&gt;
  </code></pre>
  <p>I followed along this article which allowed me to basically create my own version of ng-include in modern angular:
  <a href="https://www.linkedin.com/pulse/compiling-angular-templates-runtime-dima-slivin/" rel="nofollow noreferrer">https://www.linkedin.com/pulse/compiling-angular-templates-runtime-dima-slivin/</a></p>
  <p>But honestly, I am so confused as to why the new angular does not have its own way to do ng-include...</p>
  <p>Every example I have seen having to do with &quot;dynamic templates&quot; in modern Angular has involved <code>ng-template</code> and <code>ng-container</code> where in the context of my application (unless I am misunderstanding) the modal config would instead have templateRefs passed in and then would require a single <code>.html</code> file which would have a billion different templates like:</p>
  <pre><code>&lt;ng-template #header-for-modal-scenario-a&gt;...&lt;/ng-template&gt;
  &lt;ng-template #header-for-modal-scenario-b&gt;...&lt;/ng-template&gt;
  &lt;ng-template #header-for-modal-scenario-c&gt;...&lt;/ng-template&gt;
  &lt;ng-template #body-for-modal-scenario-a&gt;...&lt;/ng-template&gt;
  &lt;ng-template #body-for-modal-scenario-b&gt;...&lt;/ng-template&gt;
  &lt;ng-template #body-for-modal-scenario-c&gt;...&lt;/ng-template&gt;
  &lt;ng-template #footer-for-modal-scenario-a&gt;...&lt;/ng-template&gt;
  &lt;ng-template #footer-for-modal-scenario-b&gt;...&lt;/ng-template&gt;
  &lt;ng-template #footer-for-modal-scenario-c&gt;...&lt;/ng-template&gt;
  // etc
  </code></pre>
  <p>Since my app has SO many different modal header body footers (some dynamically conditionally including additional templates in them also with <code>ng-include</code>) this approach seems so incredibly dumb and horrible........  So as I am working on upgrading my app, I just am at a complete loss as to WHY <code>ng-include</code> was removed, and how is something like this supposed to be accomplished without there being a huge unwieldy <code>.html</code> file containing ALL these bazillions of template variations...  I just MUST be misunderstanding this, because there's got to be a better way to manage this in the new Angular than how I am understanding....</p>
  <p>** EDIT **</p>
  <p>Based off of one of the comments that knowing the answer of why <code>ng-include</code> isn't in the new Angular not being helpful--  I guess I am requesting suggestions of patterns/paradigms for the example of my modal service needing dynamic templates.  What is the &quot;angular way&quot; for doing this now?</p>