title: How can I pass data on button click from one component to another in Angular?
body: <p>HTML:</p>
  <pre><code> &lt;button [routerLink]=&quot;['/Request']&quot;&gt;Request&lt;/button&gt;
  </code></pre>
  <p>I am getting data in this component as product.name, product.id etc.</p>
  <p>/Request is another view and I need to redirect user to that view on button click (Right now I am achieving this via [routerLink]) and to pass the value product.id to that view, as I want to use the value on that view.</p>
  <p>Data:</p>
  <p>My data is in the form of list, where on each button click, there would be different ID.</p>
  <p>I am unable to pass the value to another view, on button click. What's the best approach?</p>