title: How to pass data from one component to another
body: <p>I have a Component called MainWizard Which is using many child components, Each Child component has an input form to take input for various fields.</p>
  <p>To pass data from one child component to another I am using a service named wizardService.
  for each shared variable I am having a subject in the service like below</p>
  <pre><code>    private warningSubject= new Subject&lt;any&gt;();
      
      setWarning(data){
          return this.warningSubject.next(data);
      }
  
      getWarning(){
        return this.warningSubject.asObservable();
      }
      
  </code></pre>
  <p>But ther are more than 20 subject like that for every variable that I need to share with other child components.</p>
  <p>Questions:</p>
  <ol>
  <li>Is it okay to use these many subjects in service to share data among components?</li>
  <li>Is there a better way to achieve this?</li>
  <li>If this way is fine, can it be further optimized with some other strategy?</li>
  </ol>