title: angular using @output to sent data from child to parent component
body: <p>I have some data that I am passing from my child to parent component and I want it to check if its empty or it has some value inside automatically.</p>
  
  <p>this is in my login.compunent.ts - child ts</p>
  
  <pre><code>@Output() update=new EventEmitter&lt;string&gt;();
  userEmail = "a@b.com";
  authUser(loginForm) {      
        this.update.emit(userEmail);
        this.router.navigate(['/home']);
    }
  </code></pre>
  
  <p>this is in my app.compunent.ts - parent ts</p>
  
  <pre><code>  emailData:string;
  
    onUpdate(userEmail:string){
      console.log("userEmail")
      if(userEmail !== ''){
        this.emailData = userEmail
        console.log(userEmail)
      }
    }
  </code></pre>
  
  <p>this is in my app.compunent.html - parernt html</p>
  
  <pre><code>{{emailData}}
  &lt;router-outlet (update)="onUpdate($event)"&gt;&lt;/router-outlet&gt;
  </code></pre>