title: How to execute a function from another component that is NOT a sibling of the first component?
body: <p>I'm trying to execute a function from another component (<strong>These 2 components are NOT siblings</strong>). My guess is that I will need to use <strong>@Output and eventEmitter</strong> to accomplish this or create a <strong>Service</strong> and subscribe to the <strong>Observable</strong> to share the same data throughout all the components (I know how to pass a message( string) but I don't know how to execute a function). I'm not really sure where to start. I'm trying to execute <strong>function1</strong> FROM <strong>function2</strong>. Can anyone help me on how to get this to work? <strong>Please provide a plunker</strong>. This is what my project looks like:</p>
  
  <pre><code>   src
     |__app(FOLDER)
        |__home(FOLDER)
        |     |
        |     |__home.component.ts 
        |                  |______function2(){
        |                          What do I need to put in here to execute function1?
        |                          }
        | 
        |__products(FOLDER) 
             |
             |__tools(FOLDER)
                    |
                    |____tools.component.ts
                                     |____function1(){
                                           alert("I'm inside function 1!!");
                                           }
  </code></pre>
  
  <p>As you saw I have a file <strong>home.component.ts</strong> that has function2 and a file <strong>tools.component.ts</strong>  that has function1, so any ideas how to execute function1 from function2 ?</p>