title: How can I use an Event Emitter to call a function that returns a value, and wait for the response before proceeding?
body: <p>So I want to emit an event from a child component that triggers a function in the parent component, but I want to wait to get a response from that parent function before proceeding.</p>
  
  <p>Child</p>
  
  <pre><code>@Output() callParentFunction = new EventEmitter&lt;any&gt;();
  
  ...
  
  this.callParentFunction.emit();
  let tempVal = responseFromParentComponent; //How can I set this value?
  //After parent function has returned a response, the next line of code should run
  console.log("Response returned");
  
  </code></pre>
  
  <p>Parent</p>
  
  <pre><code>template: `
      &lt;child-component
        (callParentFunction)="parentFunction($event)"
      &gt;
      &lt;/child-component&gt;
    `
  
  ...
  
  parentFunction(){
      //This function calls an api, then returns the response
      [API call goes here]
      return response;
  }
  </code></pre>
  
  <p>How can this event emitter be set up? Or is there a way to do it without event emitters?</p>