title: How to pass @Input string from one component to another
body: <p>I am able to pass data from one component ts file to another component HTML file. Please refer the code shown below:</p>
  
  <pre><code>export class TestComponent {
  
    @Component({
      selector: 'app-data',
    })
  
    @Input() data : string;
  }
  </code></pre>
  
  <p>And in my another component HTML file I am able to use it like as shown below:</p>
  
  <pre><code>&lt;app-data [data] = "Hello"&gt;&lt;/app-data&gt;
  </code></pre>
  
  <p>My question is instead of passing data from another component HTML file, I want to pass it from another component .ts file. I found solution using service and emitters but I want to do it using <code>@Output()</code>.</p>
  
  <p>Please let me know possible solution to do it.</p>
  
  <p><strong>Edit Use case:</strong></p>
  
  <p>I am trying to add a shared component which has some template in it. And the template gets updated based on the component where the template is used. There are lot of string messages that I am updating based on template requirement.</p>
  
  <p>So the problem is if I pass all of the string from HTML, my code will look dirty. So I am looking for instead of passing it from HTML I want to pass it from ts file.</p>
  
  <p><strong>NOTE:</strong> Both component are at same level.</p>