mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: Update outputs.md to demonstrate how to use event data (#63732)
PR Close #63732
This commit is contained in:
committed by
Jessica Janiuk
parent
cd36189ba7
commit
a2ea2ec615
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user