Now I started studying Angular, I was doing a simple exercise, but I had a giant doubt.
I have two components (Navbar and app), in navbar I present one that returns me the value 5. In the component app, by clicking the EXECUTE button, I want the value displayed in Navbar to 4 (-1). Is there a way to do this or make an event emitter that I pressed the EXECUTE button on the app component and thus perform a function on the navbar that allows me to reduce the number 5 to 4?
Thank you !
Navbar component
total:any;
number = 5;
constructor() { }
ngOnInit() {
this.GetNumber();
}
GetNumber(){
this.total = this.number - 1;
}