-
Notifications
You must be signed in to change notification settings - Fork 26.4k
docs: update binding.md to use signals #62606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank for the suggestion, we indeed would want to use signals in this guide but we also want to introduce the topic slightly. I've pushed some updates and we'll pick it up from here with @bencodezen. |
Deployed adev-preview for f7d8523 to: https://ng-dev-previews-fw--pr-angular-angular-62606-adev-prev-jd05r3kq.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
@JeanMeche great 👍 |
We'll have a look ourselves to make signals more widespread across the docs. Thanks for you help anyway ! |
theme = signal('dark'); | ||
} | ||
``` | ||
For more details, see the [Signals guide](/guide/signals). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more details, see the [Signals guide](/guide/signals). |
Since we link the signals guide already in the introductory paragraph, I don't think this line is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are suggesting the remove the whole sentence or just the link ?
@@ -25,9 +25,25 @@ In this example, when the snippet is rendered to the page, Angular will replace | |||
<p>Your color preference is dark.</p> | |||
``` | |||
|
|||
In addition to evaluating the expression at first render, Angular also updates the rendered content when the expression's value changes. | |||
Bindings that change over time should read values from [signals](/guide/signals). Angular tracks the signals read in the template, and updates the rendered page when those signal values changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindings that change over time should read values from [signals](/guide/signals). Angular tracks the signals read in the template, and updates the rendered page when those signal values changes. | |
Bindings that change over time should read values from [signals](/guide/signals). Angular tracks the signals read in the template, and updates the rendered page when those signal values change. |
```angular-ts | ||
@Component({ | ||
template: ` | ||
<p>{{welcomeMessage}}</p> <!-- Does not necessarily update when `welcomeMessage` changes. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>{{welcomeMessage}}</p> <!-- Does not necessarily update when `welcomeMessage` changes. --> | |
<!-- Does not necessarily update when `welcomeMessage` changes. --> | |
<p>{{ welcomeMessage }}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR to update this guide @robertIsaac! I've left some suggested changes. Let me know if you have any questions.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
it uses the old class properties
Issue Number: N/A
What is the new behavior?
it uses signals
Does this PR introduce a breaking change?
Other information