Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2ea2ec

Browse files
13RTKthePunderWoman
authored andcommitted
docs: Update outputs.md to demonstrate how to use event data (#63732)
PR Close #63732
1 parent cd36189 commit a2ea2ec

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎adev/src/content/guide/components/outputs.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ When defining an event listener in a template, you can access the event data fro
5252
<custom-slider (valueChanged)="logValue($event)" />
5353
```
5454

55+
Receive the event data in the parent component:
56+
57+
<docs-code language="ts" highlight="">
58+
@Component({
59+
/*...*/
60+
})
61+
export class App {
62+
logValue(value: number) {
63+
...
64+
}
65+
}
66+
67+
</docs-code>
68+
5569
## Customizing output names
5670

5771
The `output` function accepts a parameter that lets you specify a different name for the event in a template:

0 commit comments

Comments
 (0)