Browse Source

Mark as "Deprecated" FormSubmitDirective

pull/13797/head
Mahmut Gundogdu 4 years ago
parent
commit
d9deedbce7
  1. 9
      npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts

9
npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts

@ -14,7 +14,9 @@ import { debounceTime, filter } from 'rxjs/operators';
import { SubscriptionService } from '../services/subscription.service';
type Controls = { [key: string]: FormControl } | FormGroup[];
/**
* @deprecated FormSubmitDirective will be removed in V7.0.0. Use `ngSubmit` instead.
*/
@Directive({
// eslint-disable-next-line @angular-eslint/directive-selector
selector: 'form[ngSubmit][formGroup]',
@ -43,6 +45,7 @@ export class FormSubmitDirective implements OnInit {
ngOnInit() {
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => {
if (this.markAsDirtyWhenSubmit) {
this.markAsDirty();
}
@ -90,3 +93,7 @@ function setDirty(controls: Controls) {
controls[key].updateValueAndValidity();
});
}
function Deprecated(arg0: string) {
throw new Error('Function not implemented.');
}

Loading…
Cancel
Save