docs: Update outputs.md to demonstrate how to use event data (#63732)

PR Close #63732
This commit is contained in:
Uaena_Alex_John 2025-09-11 22:48:09 +08:00 committed by Jessica Janiuk
parent cd36189ba7
commit a2ea2ec615

View file

@ -52,6 +52,20 @@ When defining an event listener in a template, you can access the event data fro
<custom-slider (valueChanged)="logValue($event)" />
```
Receive the event data in the parent component:
<docs-code language="ts" highlight="">
@Component({
/*...*/
})
export class App {
logValue(value: number) {
...
}
}
</docs-code>
## Customizing output names
The `output` function accepts a parameter that lets you specify a different name for the event in a template: