Differences of using Component template vs templateUrl
<p>Angular 2 allows to write multi-line templates by using ` characters to enquote them. It is also possible to put multi-line template into <code>.html</code> file and reference it by <code>templateUrl</code>.</p>

<p>It seems comfortable for me to put the template directly into component as then it's all in one place, but is there any drawback of doing so?</p>

<p>1st approach:</p>

<pre><code>import {Component} from 'angular2/core';
@Component({
    selector: 'my-app',
    template: `
    &lt;h1&gt;My First Angular 2 multiline template&lt;/h1&gt;
    &lt;p&gt;Second line&lt;/p&gt; 
    `
})
export class AppComponent { }
</code></pre>

<p>vs 
2nd approach:</p>

<pre><code>import {Component} from 'angular2/core';
@Component({
    selector: 'my-app',
    templateUrl: 'multi-line.html'
})
export class AppComponent { }
</code></pre>

<p>together with <code>multi-line.html</code>:</p>

<pre><code>&lt;h1&gt;My First Angular 2 multiline template&lt;/h1&gt;
&lt;p&gt;Second line&lt;/p&gt; 
</code></pre>