I have a common service and I am using my service to change a variable value using click function between components. But I an getting and undefined error and also
ERROR
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngSwitch: count1'. Current value: 'ngSwitch: undefined'.
I have a made the stackblitz demo (https://stackblitz.com/edit/angular-8to3ra?embed=1&file=src/app/app.component.html) here. It would be a great help if some body just point me out what I am doing wrong. As I am very new to Angular any help would be greatly appreciated. My first question here is why I am getting undefined in my parent component from service?My second question it is not updating the count value in my parent component?