docs: fix the payload in event-binding sample code (#30429)
after reading the context. there are some clues to infer the payload should be the `item`, not `item.name`. 1. EventEmitter<Item>. 2. the desc say that: The component defines a deleteRequest property that returns an EventEmitter. When the user clicks delete, the component invokes the delete() method, telling the EventEmitter to emit an **Item** object. PR Close #30429
This commit is contained in:
parent
45e11915dc
commit
8555016eec
@ -21,7 +21,7 @@ export class ItemDetailComponent {
|
||||
@Output() deleteRequest = new EventEmitter<Item>();
|
||||
|
||||
delete() {
|
||||
this.deleteRequest.emit(this.item.name);
|
||||
this.deleteRequest.emit(this.item);
|
||||
this.displayNone = this.displayNone ? '' : 'none';
|
||||
this.lineThrough = this.lineThrough ? '' : 'line-through';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user