diff --git a/examples/19-adding-a-checkbox/src/app/todo-item/todo-item.component.ts b/examples/19-adding-a-checkbox/src/app/todo-item/todo-item.component.ts index d706878..d316a15 100644 --- a/examples/19-adding-a-checkbox/src/app/todo-item/todo-item.component.ts +++ b/examples/19-adding-a-checkbox/src/app/todo-item/todo-item.component.ts @@ -32,7 +32,7 @@ export class TodoItemComponent implements OnInit { completeItem() { this.update.emit({ item: this.item, - changes: {completed: !this.item.completed} + changes: { completed: !this.item.completed } }); } diff --git a/workshop-todo-list/adding-a-checkbox.md b/workshop-todo-list/adding-a-checkbox.md index 5f8ba76..f56606c 100644 --- a/workshop-todo-list/adding-a-checkbox.md +++ b/workshop-todo-list/adding-a-checkbox.md @@ -43,7 +43,7 @@ export class TodoItemComponent implements OnInit { completeItem() { this.update.emit({ item: this.item, - changes: {completed: !this.item.completed} + changes: { completed: !this.item.completed } }); } ``` @@ -98,7 +98,7 @@ And create additional method to handle this update item event. Very similar to ` {% code title="src/app/list-manager/list-manager.component.ts" %} ```markup -updateItem(item, changes) { +updateItem(item: TodoItem, changes: object) { this.todoListService.updateItem(item, changes); } ``` diff --git a/workshop-todo-list/local-storage.md b/workshop-todo-list/local-storage.md index 05f8974..8b4fe52 100644 --- a/workshop-todo-list/local-storage.md +++ b/workshop-todo-list/local-storage.md @@ -259,13 +259,13 @@ export class TodoListService { this.saveList(); } - updateItem(item, changes) { + updateItem(item: TodoItem, changes: object) { const index = this.todoList.indexOf(item); this.todoList[index] = { ...item, ...changes }; this.saveList(); } - deleteItem(item) { + deleteItem(item: TodoItem) { const index = this.todoList.indexOf(item); this.todoList.splice(index, 1); this.saveList(); diff --git a/workshop-todo-list/remove-item.md b/workshop-todo-list/remove-item.md index 5c12240..443a60e 100644 --- a/workshop-todo-list/remove-item.md +++ b/workshop-todo-list/remove-item.md @@ -63,7 +63,7 @@ Now we just need to add the method `removeItem()` to the `ListManagerComponent` {% code title="src/app/list-manager/list-manager.component.ts" %} ```typescript -removeItem(item) { +removeItem(item: TodoItem) { this.todoListService.deleteItem(item); } ```