Is there a way to dynamically display the project number within the header component, which is visible on all pages?
Here is the code for the Header component:
<div class="d-flex flex-column flex-md-row align-items-center px-md-4 bg-brown text-white ">
<h2 class="my-0 mr-md-auto">
<span>Project {{numero}}</span></h2>
<nav class="my-2 my-md-0 mr-md-3">
<a class="p-2 text-white" href="#">Projects</a>
<a class="p-2 text-white" href="#">Exit</a>
</nav>
</div>
And here's how it's included in other components' HTML files:
<app-header></app-header>
<div>my component</div>
In the corresponding typescript file (.ts), the 'numero' variable is defined as follows:
numero: string = "MY NUMERO";
Now the question arises: How can we pass and update the 'number' value in the header from other components? Should we utilize @Input () decorator for this purpose?
Your valuable insights are greatly appreciated. Thank you.