mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: Update outputs.md to demonstrate how to use event data (#63732)
PR Close #63732
This commit is contained in:
parent
cd36189ba7
commit
a2ea2ec615
1 changed files with 14 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue