re: Simple state management in Angular with only Services and RxJS VIEW POST


Hi, in the user's code I've noticed, that you pass 'event' to the remove method:

Shouldn't it be just an 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).

code of conduct - report abuse