Yea, I completely agree, they are the same, I guess there is a real small advantage to use todo.id instead of $event - if we use todo.id we explicitly say that we wanna to use id property from list of todos, otherwise if we use $event we delegate the responsibility to the child component to use 'remove' event properly (pass the correct value).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, in the user's code I've noticed, that you pass 'event' to the remove method:
(remove)="todosStore.removeTodo($event)"
Shouldn't it be just an id?:
(remove)="todosStore.removeTodo(todo.id)"
both are correct, if the app-todo-component outputs the todo id in the event, it'll still work
depends on the implementation of the @Ouptut
Yea, I completely agree, they are the same, I guess there is a real small advantage to use todo.id instead of $event - if we use todo.id we explicitly say that we wanna to use id property from list of todos, otherwise if we use $event we delegate the responsibility to the child component to use 'remove' event properly (pass the correct value).