Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
});
}

Expand Down
4 changes: 2 additions & 2 deletions workshop-todo-list/adding-a-checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
});
}
```
Expand Down Expand Up @@ -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);
}
```
Expand Down
4 changes: 2 additions & 2 deletions workshop-todo-list/local-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion workshop-todo-list/remove-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
```
Expand Down