title: Send Variabel to another component in Angular
body: <p>I want to send a variable to another component.</p>
  
  <p>HTML-doc in component A where I want to send user.id to component B</p>
  
  <pre><code>&lt;li class="list-group-item list-group-item-action" *ngFor="let user of users"&gt;
   &lt;a routerLink="/profile"  routerLinkActive="active" (click)="testFunc(user.id)"&gt;
    {{user.name}}
   &lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Component A where I want to send the id to component B (This is where I'm stuck)</p>
  
  <pre><code> testFunc (id: JSON): string {
      //Send to component B
    }
  </code></pre>
  
  <p>I don't know if this is enough information but I can provide with more if needed.</p>