Is it possible to import an HTML file as a string with TypeScript? : <p>I wonder if it is possible to do as the title said.</p>

<p>For example let's say we are working on a Angular2 project and we want to avoid set the template as an external url in order to have less http requests. Still we don't want to write all the HTML within the component because maybe it's big enough or we want designers to work in different files than devs.</p>

<p>So here is a first solution:</p>

<p>File <strong><em>template.html.ts</em></strong>
Transform a file to .ts to something like this:</p>

<pre><code>export const htmlTemplate = `
   &lt;h1&gt;My Html&lt;/h1&gt;
`;
</code></pre>

<p>Then in my component I can import it like this:</p>

<pre><code>import { Component } from 'angular2/core';
import {RouteParams, RouterLink} from 'angular2/router';
import {htmlTemplate} from './template.html';

@Component({
  selector: 'home',
  directives: [RouterLink],
  template:  htmlTemplate,
})
</code></pre>

<p>Actually this works perfectly but you are loosing the IDE HTML intelligence so this is bad for the designer/dev that creates the HTML templates.</p>

<p>What I'm trying to achieve is to find a way to import <strong><em>.html</em></strong> files and not .ts.</p>

<p><strong>So is it possible to import an .html file as a string in TypeScript?</strong></p>
