mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(forms): relax [formField] input type from FieldTree to Field
`FieldTree` was an unnecessarily specific type for the `[formField]` input. It forced the directive to care about what _kind_ of `FieldTree` was bound–specifically whether it was Reactive Forms compatible or not. This made it difficult to author forms system-agnostic components with passthrough `[formField]` inputs.
This commit is contained in:
@@ -48,7 +48,7 @@ runInEachFileSystem(() => {
|
||||
const diags = env.driveDiagnostics();
|
||||
expect(diags.length).toBe(1);
|
||||
expect(extractMessage(diags[0])).toBe(
|
||||
`Type 'null' is not assignable to type 'FieldTree<any, string | number>'.`,
|
||||
`Type 'null' is not assignable to type 'Field<any, string | number>'.`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ runInEachFileSystem(() => {
|
||||
const diags = env.driveDiagnostics();
|
||||
expect(diags.length).toBe(1);
|
||||
expect(extractMessage(diags[0])).toBe(
|
||||
`Type 'string' is not assignable to type 'FieldTree<any, string | number>'.`,
|
||||
`Type 'string' is not assignable to type 'Field<any, string | number>'.`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user