test(ivy): fixes in the TodoMVC example (#23161)
- properly display initial checked state - properly remove a todo Please note that the 'archive' option still doesn't work correctly as listening to component outputs doesn't seem to work (onArchive() is never called). PR Close #23161
This commit is contained in:
		
							parent
							
								
									f99cb5c995
								
							
						
					
					
						commit
						32a41bc738
					
				| @ -33,7 +33,7 @@ export class AppState { | |||||||
|   // but NgForOf expects creation and binding separate.
 |   // but NgForOf expects creation and binding separate.
 | ||||||
|   template: ` |   template: ` | ||||||
|     <div> |     <div> | ||||||
|       <input type="checkbox" [value]="todo && todo.done" (click)="onCheckboxClick()">&ngsp; |       <input type="checkbox" [checked]="todo && todo.done" (change)="onCheckboxClick()">&ngsp; | ||||||
|       <span [class.done]="todo && todo.done">{{todo && todo.text}}</span>&ngsp; |       <span [class.done]="todo && todo.done">{{todo && todo.text}}</span>&ngsp; | ||||||
|       <button (click)="onArchiveClick()">archive</button> |       <button (click)="onArchiveClick()">archive</button> | ||||||
|     </div> |     </div> | ||||||
| @ -71,7 +71,7 @@ export class ToDoAppComponent { | |||||||
| 
 | 
 | ||||||
|   onArchive(item: ToDo) { |   onArchive(item: ToDo) { | ||||||
|     const todos = this.appState.todos; |     const todos = this.appState.todos; | ||||||
|     todos.splice(todos.indexOf(item)); |     todos.splice(todos.indexOf(item), 1); | ||||||
|     markDirty(this); |     markDirty(this); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user