Let's add an event emitter in our application to update the navbar.
We'll cover the following
An Event Emitter allows us to emit custom events within our application. We can emit to components such as
NavbarComponent whenever a user has been logged in so that it can make event updates as needed, such as updating its template.
login method in
AuthService is one place where we’ll be emitting such an event, because it’s based on whether a user is logged in.
Below is our updated code. Use this to make further changes.