title: Routes with params Angular 6
body: <p>I have a component that is a button and that stores objects in a variable called <code>Microphones</code>. And I want the button to pass the object to another component and then show details of that specific object. But it is not working for me.</p>
  <p>It is assumed that in my routes I define that the presentation component has a parameter, that parameter I passed it with the button from the line of <code>[routerLink]</code>. But in the console it appears to me that the parameter is <code>undefined</code>.</p>
  <h1>button-menu.component.ts</h1>
  <pre><code>export class ButtonMenuComponent implements OnInit {
  
    @Input()Microfonos:any;
    @Input()NombreClasificacion:any;
  
    micObj:any
  
    constructor() { }
  
    ngOnInit() { }
  
  }
  </code></pre>
  <h1>button-menu.component.html</h1>
  <pre><code>&lt;div class=&quot;btn-group dropright&quot;&gt;
      &lt;button type=&quot;button&quot; class=&quot;btn beige dropdown-toggle&quot; data-toggle=&quot;dropdown&quot; data-display=&quot;static&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;{{NombreClasificacion}}&lt;/button&gt;
      &lt;div class=&quot;dropdown-menu dropdown-menu-lg-left&quot;&gt;
          &lt;button *ngFor=&quot;let mics of Microfonos&quot; class=&quot;dropdown-item beige text-center&quot; type=&quot;button&quot; [routerLink]=&quot;['/presentacion',mics]&quot;&gt;{{mics.nombre}}&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <h1>app-routing-module.ts</h1>
  <pre><code>const routes: Routes = [
    {
    path:'menu',
    component: MainComponent,
    },
    {
      path:'bajo',
      component: MenuBajoComponent
    },
    {
      path:'guitarra',
      component: MenuGuitarraComponent
    },
    {
      path:'presentacion/:objMic',
      component:PresentacionMicComponent
    }
  ];
  </code></pre>
  <pre><code>export class PresentacionMicComponent implements OnInit {
  
    objMic:any;
  
    constructor(private rutaActiva:ActivatedRoute) { 
      this.rutaActiva.params.subscribe( params =&gt; {
        this.objMic = params['mics'];
      });
      console.log(this.objMic);
    }
  
    ngOnInit() { }
  
  }
  </code></pre>