I have an authentication service that makes the authenticated variable equal to true or false.
checkAuthentication(){
this._authService.getAuthentication()
It depends on who needs to handle the event. If it's the parent component, you can leverage output event bindings:
@Output authenticationChange: EventEmitter = new EventEmitter();
checkAuthentication(){
this._authService.getAuthentication()
.subscribe(value =>
if(value != this.authenticated) {
this.authenticated = value);
this.authenticationChange.emit(value);
});
}
And in your parent component: