I have a problem with my angular 4 project. In fact I want to send a variable to my parent component. My main component have a variable user :
export class AppComponent {
public user: User = null;
}
His HTML is :
{{user.name}}
<router-outlet></router-outlet>
Instead of router-outlet I have a children component that changes the value of user when I call login():
export class ChildrenComponent {
login() {
user.name = 'Toto';
}
}
Now I would like to sent the value of user to parent component.