#State synchronization between components

2 messages · Page 1 of 1 (latest)

misty igloo
#

Component 1:

stateService.selectedTodoName.set(newName)

Component 2:

selectedTodoName = inject(StateService).selectedTodoName;

Template of component2:

The todo is: {{ selectedTodoName() }}
#

If you're still stuck, post a complete minimal repro as a stackblitz, as explained in #how-to-get-help