docs: fix the wrong way to get a signal value (#59194)

PR Close #59194
This commit is contained in:
Lang 2024-12-16 20:02:21 +01:00 committed by Miles Malerba
parent d3dde17693
commit 080fb08b76

View file

@ -74,7 +74,7 @@ import { Component, model } from '@angular/core';
selector: 'app-counter',
template: `
<button (click)="updateCount(-1)">-</button>
<span>{{ count }}</span>
<span>{{ count() }}</span>
<button (click)="updateCount(+1)">+</button>
`,
})
@ -89,11 +89,9 @@ export class CounterComponent {
### Enabling two-way binding between components
If we break down the example above to its core , each two-way binding for components requires the following:
If we break down the example above to its core, each two-way binding for components requires the following:
The child component must contain:
1. A `model` property
The child component must contain a `model` property.
Here is a simplified example:
@ -114,7 +112,7 @@ export class CounterComponent {
The parent component must:
1. Wrap the `model` property name in the two-way binding syntax.
1. Specify the corresponding property to which the updated value is assigned
1. Assign a property or a signal to the `model` property.
Here is a simplified example: