<p dir="auto">See here:</p>
<p dir="auto"><a href="http://plnkr.co/edit/sKkTPTraGIP2BcLWzEQU?p=preview" rel="nofollow">http://plnkr.co/edit/sKkTPTraGIP2BcLWzEQU?p=preview</a></p>
<p dir="auto">It is a situation that occurs after minification with mangling, but I tried to reproduce without minification by using the same class name for both components  (since I don't know how to easily provide a minified example in Plunkr). Mangling will typically convert all class names to something like "a".<br>
As you can see, both components are rendered with the template of Component2, unless you switch back to beta.0.</p>
<p dir="auto">I have found several other issues about minification, but not any open one that is exactly the same as this.<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="125920583" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/6397" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/6397/hovercard" href="https://github.com/angular/angular/pull/6397">#6397</a> mentions there might be name collisions in TemplateCompiler.</p>
<p dir="auto">Hello,</p>
<p dir="auto">I have trouble for build an application with <code class="notranslate">JSPM</code> and <code class="notranslate">angular2</code> (<code class="notranslate">2.0.0-beta.0</code>).</p>
<p dir="auto">When we install <code class="notranslate">angular2</code> through <code class="notranslate">npm</code>, the package is in <code class="notranslate">node_modules</code> and with a good <code class="notranslate">tsconfig</code> configuration we can load <code class="notranslate">angular2</code> modules with TypeScript without trouble like this:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Component } from 'angular2/core';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Component</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'angular2/core'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But I use <code class="notranslate">JSPM</code> for my app.</p>
<p dir="auto">So I install <code class="notranslate">angular2</code> through it and <code class="notranslate">JSPM</code> put the dependency in the subfolder <code class="notranslate">jspm_packages</code> by default. When I load it in the browser with <code class="notranslate">SystemJS</code> I don't have any problems.</p>
<p dir="auto">The only issue is in the TypeScript compiler.</p>
<p dir="auto">When I try to import <code class="notranslate">angular2</code> modules, the TypeScript compiler will try to load modules specify in <code class="notranslate">tsconfig</code> (<code class="notranslate">files</code>) and in <code class="notranslate">node_modules</code> but like I said, the dependency isn't in <code class="notranslate">node_modules</code> but in <code class="notranslate">jspm_packages</code>.</p>
<p dir="auto">Therefore, I have the following error which is normal :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Cannot find module 'angular2/core';"><pre class="notranslate"><code class="notranslate">Cannot find module 'angular2/core';
</code></pre></div>
<p dir="auto">Because TypeScript try to load <code class="notranslate">nodes_modules/angular2/core</code> instead of <code class="notranslate">jspm_packages/.../angular2/core</code>.</p>
<p dir="auto">So, my question is how I can do for load <code class="notranslate">angular2</code> correctly inside the TypeScript compiler ?</p>