How to pass data to component to another component : <p>I need help, at the last days I was tring to pass data between components... I followed alot of samples around internet, and none of those works.</p>

<p>The most tutorials says to me to use @input and @output. i think this is the most correct way to pass data in angular...</p>

<p>Here is my structure:</p>

<p>The componentA is called in html of componentC, like this: </p>

<pre><code>&lt;app-componentA&lt;/app-componentA&gt;
</code></pre>

<p>The componentB is called via modalController</p>

<p><a href="https://i.stack.imgur.com/By6jF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/By6jF.png" alt="my structure"></a></p>

<p>in my actual code, i pass the data generated in componentB to componentC like this:</p>

<pre class="lang-js prettyprint-override"><code>// componentB.ts
  dimiss(filters?: any) {
    this.modalController.dismiss(filters);
  }
</code></pre>

<p>and recive in componentC:</p>

<pre class="lang-js prettyprint-override"><code>// componentC.ts
const filters = await modal.onDidDismiss();
this.Myfilters = filters ;
</code></pre>

<p>now how i pass the data from componentB to ComponentA?</p>
