title: Change route parameter by name without knowing full route
body: <p>In Angular 2, is it possible to get the current URL, modify a parameter by its configured name and then navigate to it?</p>
  
  <p>Example routes</p>
  
  <pre><code>path: 'home'
  path: 'heroes/:universe'
  path: 'villains/:universe'
  </code></pre>
  
  <p>Valid URLs include:</p>
  
  <ul>
  <li><a href="https://example.com/home" rel="nofollow noreferrer">https://example.com/home</a></li>
  <li><a href="https://example.com/heroes/marvel" rel="nofollow noreferrer">https://example.com/heroes/marvel</a></li>
  <li><a href="https://example.com/heroes/capcom" rel="nofollow noreferrer">https://example.com/heroes/capcom</a></li>
  <li><a href="https://example.com/villains/marvel" rel="nofollow noreferrer">https://example.com/villains/marvel</a></li>
  <li><a href="https://example.com/villains/capcom" rel="nofollow noreferrer">https://example.com/villains/capcom</a></li>
  </ul>
  
  <p>Now somewhere in the root component I'd like to have a selection of universes.</p>
  
  <pre><code>// in App.component.ts
  universe: string;  
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;!-- in App.component.html --&gt;
  &lt;select [(ngModel)]="universe" (ngModelChange)="navigateToUniverse($event)"&gt;
      &lt;option value="marvel"&gt;Marvel&lt;/option&gt;
      &lt;option value="capcom"&gt;Capcom&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Examples</p>
  
  <ul>
  <li>The current route is <code>/heroes/marvel</code> and I select Capcom -> navigate to <code>/heroes/capcom</code></li>
  <li>The current route is <code>/villains/marvel</code> and I select Capcom -> navigate to <code>/villains/capcom</code></li>
  </ul>
  
  <p>In my head, I imagine it should be possible to do this:</p>
  
  <pre><code>// in App.component.ts
  navigateToUniverse(universe: string): void {
      /*
      * 1. get the route config of the current ActivatedRoute
      *    eg. /heroes/:universe
      *   -or- /villains/:universe
      *    (or /home)
      * 2. replace the :universe parameter with the selected value
      * 3. call Router.navigate with the new URL
      * /
  }
  </code></pre>
  
  <p>I'm already stuck on the first step. There doesn't seem to be anything in <code>ActivatedRoute</code> that will get me the route config for the current route.</p>