更新时间:2023-10-29 23:26:40
问题是你在 valueChanges
事件处理程序中为同一字段修改了字段的值,导致事件再次触发:
The problem is that you modify the value of the field inside of the valueChanges
event handler for that same field, causing the event to be triggered again:
this.userForm.get('loginTypeId').valueChanges.subscribe(
(loginTypeId: string) => {
...
this.userForm.get('loginTypeId').updateValueAndValidity(); <-- Triggers valueChanges!
}