I have a button that works as a timer. I created a service so that it is possible to present the operation of this button in several components simultaneously.
My problem is that I can't display the time count on both components when it starts. I've tried a few ways, but without success, can anyone help me?
html
<div class="btn-group" dropdown>
<button id="button-basic" dropdownToggle aria-controls="dropdown-basic">
<img *ngIf="taskService.getCurrentState() === 'pause' || taskService.getCurrentState() === undefined" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcW6cJlI-KlS721hkuHDTMydZ_snrkhL9sm9wYHWRhd3FlvF1b&s" width="50" height="50">
<img *ngIf="taskService.getCurrentState() ==='start'"
src="https://png.pngtree.com/png-clipart/20190516/original/pngtree-pause-vector-icon-png-image_3791321.jpg" width="50" height="50">
</button>
<div class="timer">
<!-- <span>{{(taskService.timerForUsers[data.key.ID].currentTime * 1000) | date:'HH:mm:ss':'UTC'}}</span> -->
<!-- <span>{{(taskService.timerForUsers[data.key.ID].currentTime * 1000) | date:'HH:mm:ss':'UTC'}}</span> -->
</div>