refactor(forms): ngForm
element selector has been deprecated in favor of ng-form
(#23721)
This has been deprecated to keep selector consistent with other core Angular selectors. As element selectors are in kebab-case. Now deprecated: ``` <ngForm #myForm="ngForm"> ``` After: ``` <ng-form #myForm="ngForm"> ``` You can also choose to supress this warnings by providing a config for `FormsModule` during import: ```ts imports: [ FormsModule.withConfig({warnOnDeprecatedNgFormSelector: 'never'}); ] Closes: #23678 PR Close #23721
This commit is contained in:
7
tools/public_api_guard/forms/forms.d.ts
vendored
7
tools/public_api_guard/forms/forms.d.ts
vendored
@ -330,6 +330,8 @@ export declare class FormGroupName extends AbstractFormGroupDirective implements
|
||||
}
|
||||
|
||||
export declare class FormsModule {
|
||||
static withConfig(opts: { warnOnDeprecatedNgFormSelector?: 'never' | 'once' | 'always';
|
||||
}): ModuleWithProviders;
|
||||
}
|
||||
|
||||
export declare class MaxLengthValidator implements Validator, OnChanges {
|
||||
@ -398,6 +400,11 @@ export declare class NgForm extends ControlContainer implements Form, AfterViewI
|
||||
updateModel(dir: NgControl, value: any): void;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export declare class NgFormSelectorWarning {
|
||||
constructor(ngFormWarning: string | null);
|
||||
}
|
||||
|
||||
export declare class NgModel extends NgControl implements OnChanges, OnDestroy {
|
||||
readonly asyncValidator: AsyncValidatorFn | null;
|
||||
readonly control: FormControl;
|
||||
|
Reference in New Issue
Block a user