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:
Alan
2018-08-01 07:17:58 +02:00
committed by Igor Minar
parent 5982425436
commit 3ba5220839
8 changed files with 153 additions and 8 deletions

View File

@ -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;