<p dir="auto"><strong>I'm submitting a ...</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report 
[x] feature request
[ ] support request"><pre class="notranslate"><code class="notranslate">[ ] bug report 
[x] feature request
[ ] support request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
NgModule cannot declare providers/service they need. It can only provide a service for global instanciation.<br>
I see only two options :</p>
<ol dir="auto">
<li>The provider/service is defined above the NgModule, and it can be used in the NgModule. The service is shared according to scope, but this requiers the service to be instanciated even though it is never going to be used. I find this in contradiction with the goal of dynamic/lazy loading. Also An application must be aware of what service are needed by its underneath NgModules.</li>
<li>The provider/service is provided to the application with NgModule.providers and it is instanciated globally... If another NgModule provides the same Service, the service will be reinstanciated caussing possibly two instances. Also if the NgModule is loaded dynamically by route, the service is reinstanciated each time the route is activated. I find this option in contradiction with the idea of sharing a Service for multiple usage.</li>
</ol>
<p dir="auto">As a result, <code class="notranslate">NgModule.providers</code> is not really usable except to instanciate global service the NgModule defines or to instanciate local service when loaded dynamically.</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
Wouldn't it be great if an NgModule could just use existing service or create a new global instance if not yet created ? what do you think ?<br>
I sugest :</p>
<ol dir="auto">
<li>The addition of a new descriptor (<code class="notranslate">NgModule.uses</code> or <code class="notranslate">NgModules.services</code> or <code class="notranslate">NgModule.injects</code>) to list all Services that are requiered by the NgModule to work. Implementation would inject a new Service of that class or inject yet created instance. This would allow for late loading/instantiation of Services and save boot time.</li>
<li>The renaming of <code class="notranslate">providers</code> into <code class="notranslate">provides</code> to make it clearer what this is.</li>
</ol>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
Benefits :</p>
<ol dir="auto">
<li>No need to declare service before they are actually needed.
<ul dir="auto">
<li>main.module.ts is easier to read because there are only the providers/services necessary at bootime.</li>
<li>developpers don't need to check services needed by NgModules they don't know.</li>
</ul>
</li>
<li>NgModules can declare providers they need without conflicts.
<ul dir="auto">
<li>module make it cleat what providers they need.</li>
<li>module make it clear what service they provide.</li>
</ul>
</li>
<li>Service can be loaded and reused dynamically.
<ul dir="auto">
<li>Modules loaded dynamically can declare a local service they can latter reuse.</li>
<li>Service is instanciated only when it is actually needed (by the first dynamically loaded NgModule)</li>
</ul>
</li>
<li>Better distribution of code.
<ul dir="auto">
<li>say Two NgModule XModule1 and XModule2 share data through a service XService that is of no use to the rest of the application. XModule1, XModule2 and Xservice can be better distributed in one bundle and XService don't need to be statically referenced in application code.</li>
</ul>
</li>
</ol>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.5</li>
</ul>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x ] bug report
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x ] bug report
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
When selecting a <code class="notranslate">[routerLink]</code> there appear to be no styles to indicate to the user that that routerLink is the selected one.  Router used to add class <code class="notranslate">outer-link-active</code> but this doesn't seem to be the case now.  Can be seen in the official documentation's plunker <a href="https://angular.io/resources/live-examples/router/ts/plnkr.html" rel="nofollow">https://angular.io/resources/live-examples/router/ts/plnkr.html</a></p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
The currently selected routerLink should have a class applied to allow styling, such as <code class="notranslate">router-link-active</code>.</p>
<p dir="auto"><strong>Reproduction of the problem</strong><br>
<a href="https://angular.io/resources/live-examples/router/ts/plnkr.html" rel="nofollow">https://angular.io/resources/live-examples/router/ts/plnkr.html</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Class applied</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
Informing users of currently selected route.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.3</li>
<li><strong>Browser:</strong> Chrome latest Mac and FF latest Mac.</li>
<li><strong>Language:</strong> Typescript 1.8.10</li>
</ul>