Two-way binding documentation is missing important information

オープン 初心者向け
#71,796 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #71797 @lazerg による — マージされずにクローズ
  • #71835 @manjitks による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
angular, typescript
領域
documentation

調査の方向性

まず guide/templates/two-way-binding から始め、リンク先の model inputs ガイドと model API ドキュメントで現在の例を確認してください。双方向バインディングのガイドを更新し、banana-in-a-box と input/output の組み合わせの両方を示す簡潔な例を追加して、親の変更では子の change イベントがすぐには発生しないことを説明してください。重要な動作が一か所で明確になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area: docs
Describe the problem that you experienced

When it comes to two-way binding (using the model signal), arguably the most important piece of information is that a value = model<string>(); declared in a child component can be used in the parent's template as either:

  1. Banana-in-a-box: [(value)]="someValue"
  2. A pair of input and output: [value]="someValue" (valueChange)="onSomeValueChanged($event)"

And in the second case, we can additionally assume that whenever someValue changes in the parent component, and gets passed to child, onSomeValueChanged() will not immediately be called back on the parent component - which is critical for the "Data Down, Actions Up (DDAU)" / "unidirectional data flow" principle.


Unfortunately, learning this from the Angular documentation at https://angular.dev/ is not easy. The following links contain just small pieces of this puzzle:

And even putting them all together doesn't fully convey the message described above.

Can we please update the documentation to describe the message from the top of this ticket, in a single place, in a brief way, with a good, illustrative example? (preferably instead of some of the existing content, which is rather unhelpful)

Enter the URL of the topic with the problem

https://angular.dev/guide/templates/two-way-binding

Describe what you were looking for in the documentation

I was trying to teach a colleague how to use a two-way binding, and was looking for good documentation.

Describe the actions that led you to experience the problem

No response

Describe what you want to experience that would fix the problem

No response

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

If the problem is browser-specific, please specify the device, OS, browser, and version

Provide any additional information here in as much as detail as you can

主要言語
TypeScript
スター
102k
フォーク
28.2k
平均マージ
2日 10分
マージ済み PR(30日)
402

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angular のほかの issue

angular/angular の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。