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.
this is in my login.compunent.ts - child ts
@Output() update=new EventEmitter<string>();
userEmail = "[email protected]";
authUser(loginForm) {
this.update.emit(userEmail);
this.router.navigate(['/home']);
}
this is in my app.compunent.ts - parent ts
emailData:string;
onUpdate(userEmail:string){
console.log("userEmail")
if(userEmail !== ''){
this.emailData = userEmail
console.log(userEmail)
}
}
this is in my app.compunent.html - parernt html
{{emailData}}
<router-outlet (update)="onUpdate($event)"></router-outlet>