angular / angular/components

docs-bug(coercion): Add a statement on how these functions relate to the Angular@^16 input transformers

オープン
#27,718 コメント 1 件 リアクション 1 件 担当者 1 名 @crisbeto が担当を希望しています GitHub で見る
area: cdk/coercion docs P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Documentation Feedback

#18840 suggested input decorators for input coercion. It seems like they have finally landed in v16 in the form of the [transform property](https://angular.io/api/core/Input#transform) on the `Input()` decorator. It looks like CDK’s [coerceBooleanProperty](https://github.com/angular/components/blob/main/src/cdk/coercion/boolean-property.ts#L16) and Angular’s [booleanAttribute](https://github.com/angular/angular/blob/16.2.2/packages/core/src/util/coercion.ts#L21) even are the same function, albeit worded differently.

I would appreciate a documentation update either here in the coercion section or in the “base” Angular docs regarding the two approaches to coercion: Is one in some way superior to the other? Will CDK’s version get deprecated? Can/should code safely be upgraded from CDK conversion to ‘native’?

### Affected documentation page

https://material.angular.io/cdk/coercion/overview

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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