You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FormBuilder.group() calls each custom-validator 3 times #14551
changed the title [-]FormBuilder.group() calls each custom-validator 4 times[/-][+]FormBuilder.group() calls each custom-validator 3 times[/+]on Feb 17, 2017
Custom validators are often used for http validation. Why do 3 http requests if one is enough and nothing changed? Please reopen as a feature request then.
Reacted by Yaroslav Admin, Sergey Shevchenko, Saša Nikolić, Viktor Moiseiev, Kélvin Santiago, Dimitar Todorov, johnny kim, Valentin Despa, Sushant Rao and Youngho Jeong
@MickL Try using a small delay in your pipe before doing your http request. This causes the async validators to be cancelled before the request happens, as the validation engine cancels the ongoing validations.
angular-automatic-lock-bot commented on Sep 13, 2019
Activity
[-]FormBuilder.group() calls each custom-validator 4 times[/-][+]FormBuilder.group() calls each custom-validator 3 times[/+]kelvinsleonardo commentedon Oct 31, 2017
I have same problem, is there any solution of it ?
mhevery commentedon Dec 19, 2017
There is no guarantees how many times the validator gets called. Your code should be idempotent to the number of calls.
MickL commentedon Dec 19, 2017
Custom validators are often used for http validation. Why do 3 http requests if one is enough and nothing changed? Please reopen as a feature request then.
MickL commentedon Mar 14, 2018
@mhevery Please reopen! Imagine having 1 million users and 3 million requests instead of 1 million. Thats an unnecessary workload of 300%.
seritools commentedon Apr 20, 2018
@MickL Try using a small delay in your pipe before doing your http request. This causes the async validators to be cancelled before the request happens, as the validation engine cancels the ongoing validations.
angular-automatic-lock-bot commentedon Sep 13, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.