title: angular 2 - subscribe function called twice
body: <p>I have this code:</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { ViewService } from './view.service';
  import { Router, ActivatedRoute, Params } from '@angular/router';
  
  
  @Component({
    selector: 'app-view',
    templateUrl: './view.component.html',
    styleUrls: ['./view.component.css'],
    providers: [ViewService]
  })
      export class ViewComponent {
  
        constructor(viewService: ViewService, private route: ActivatedRoute) {
  
          this.route.params.map(params =&gt; params['id']).subscribe((id) =&gt; {
              console.log("id: "  + id);
          });
  
        }
      }
  </code></pre>
  
  <p>I have subscribed my code to the run parameters.
  The thing is - subscribe function is called <strong>twice</strong> - 
  First time - id is undefined.
  Second time - id value exists.</p>
  
  <p>What could be the cause for this issue?</p>