Angular2 router undefined
<p>I want to use the Router to retrieve the current URL(router) being displayed. To achieve this, I import the Router.</p>

<pre><code> import {RouteParams,Router} from 'angular2/router';
</code></pre>

<p>Next, I add it to the constructor of my component.</p>

<pre><code>   constructor(public router : Router)
</code></pre>

<p>Now, whenever I try to call anything on it, I get errors, because 'router' remains undefined. </p>

<p>I read that there is another way of getting the URL by using 'location', but that this is not the recommended way. If however, Router is not the correct way of achieving this, I'm open for any suggestions. But I'd preferably find out why Router is undefined in this case.</p>

<p>The <code>ROUTER_PROVIDERS</code> have been specified like this:</p>

<pre><code>bootstrap(AppComponent, [
    ROUTER_PROVIDERS, HTTP_PROVIDERS,....])
</code></pre>