<p dir="auto">There're some duplicate declarations, for instance:</p>
<ul dir="auto">
<li><code class="notranslate">isValidDirective</code> (both in <code class="notranslate">directive_resolver.ts</code> and <code class="notranslate">runtime-metadata.ts</code>, in case <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="109990638" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/4548" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/4548/hovercard" href="https://github.com/angular/angular/pull/4548">#4548</a> gets merged)</li>
<li><code class="notranslate">flattenList</code> (both in <code class="notranslate">runtime-metadata.ts</code> and <code class="notranslate">proto_view_factory.ts</code>)</li>
</ul>
<p dir="auto">It'll be nice if we extract them to separate file and include them wherever they are required.</p>
<p dir="auto">If it makes sense I can take this one.</p>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> bug report =&gt; search github for a similar issue or PR before submitting</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> feature request</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> support request =&gt; Please do not submit support request here, instead see <a href="https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question">https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question</a></li>
</ul>
<p dir="auto"><strong>Current behavior</strong><br>
Doesn't seem possible to do it in an easy way without not use framework core stuff</p>
<p dir="auto"><strong>Expected behavior</strong><br>
To be able to determine by an asynchronous condition (a condition that will be resolved later) which component to load in a route.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
I'd say the following is a very common behavior expected on any medium size app:</p>
<p dir="auto">Let's say you have a dashboard (just after you login). You wanna keep 2 different components UserDashboard and AdminDashboard (for not filling your template code with *ngIf), but that condition cannot be resolved immediately because the role comes from an API, so then you cannot "right away" conditionally pass one component or another to a specific route.</p>
<p dir="auto">This doesn't seem to have an answer that implies not to compile and load a component by yourself.<br>
Please, check out <a href="http://stackoverflow.com/questions/39688929/angular-2-how-to-conditionally-load-a-component-in-a-route-asynchronously" rel="nofollow">http://stackoverflow.com/questions/39688929/angular-2-how-to-conditionally-load-a-component-in-a-route-asynchronously</a></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.1</li>
</ul>