【问题标题】:Angular 5 Reactive Forms, Add debounce time to FormControl inside FormArrayAngular 5 Reactive Forms,向 FormArray 内的 FormControl 添加去抖动时间
【发布时间】:2018-03-21 13:41:06
【问题描述】:

我有一个名为邀请的 formArray,

this.userInviteForm = this.fb.group({
  invites: this.fb.array([ this.buildInvite() ])
});

buildInvite(): FormGroup {
return this.fb.group({
  userIdentifier: ['', [Validators.required, Validators.pattern(EMAILPHONE_REGEX)]],
  roleId: ['', [Validators.required]]
});

}

如何将去抖时间添加到邀请数组的userIdentifier 字段,以便用户在出现模式验证错误之前有一些时间。

【问题讨论】:

    标签: angular5 angular-reactive-forms angular-forms reactive-forms


    【解决方案1】:

    我正在调查同样的问题,发现使用 Angular 6.1.0 我不需要去抖器,请查看此实现:https://stackblitz.com/edit/angular-reactive-form-playground?file=src/app/app.component.ts

    你会看到验证发生了,但是状态不是无效的。

    【讨论】:

      猜你喜欢
      • 2020-07-24
      • 2018-09-06
      • 2022-12-27
      • 2018-02-07
      • 1970-01-01
      • 2018-10-13
      • 2021-10-23
      • 2018-05-20
      • 1970-01-01
      相关资源
      最近更新 更多