title: Angular2 pass data to route from component
body: <p>I need to pass data from one component to another, I found only the way to do it with route parameters in url:</p>
  
  <p>So I have such configuration for target component in router:</p>
  
  <pre><code>{
      path: 'edit-tags/:type/:name/:id',
      component: EditTagsComponent,
  },
  </code></pre>
  
  <p>And I use it like that from another component:</p>
  
  <pre><code>this.router.navigate([`../edit-tags/${product.type}/${product.name}/${product.id}`], { relativeTo: this.route });
  </code></pre>
  
  <p>It works ok, but I don't want to show <code>id</code> in url and also need to pass some more data to the component. </p>
  
  <p>Also I've seen using configurations like that in router:</p>
  
  <pre><code>{ path: 'test-product', component: ProductsContentComponent, data: { role: 'admin', type: 'test-product' } }
  </code></pre>
  
  <p>But I haven't found an example of using the same approach inside another component.</p>
  
  <p>So, is there a way to pass some data from component to component on routing without reflecting it in url?</p>