todo-item.component.ts
.click
event handler that calls a removeItem
method (which we'll create in a moment):TodoItemComponent
class, which will emit the removed item to the list manager when a user presses its remove button:EventEmitter
and Output
:ItemComponent
class to actually emit the event. This method will be called when the user clicks the "remove" button:list-manager.component.ts
.remove
event. Let's add it to the template, inside the <todo-item>
tag:removeItem()
to the ListManagerComponent
class, and use the todoListService
's method deleteItem
which will remove the item from the list and update the local storage: