Injecting a Service into an Async Validator in Angular

Luka Onikadze
2 min readMay 15, 2020
Photo by Ravi Roshan on Unsplash

Whenever we use a custom async validator, mostly we want to send an HTTP request to a server, and validate the input based on a response. if we navigate to the Angular Documentation, there is no information about how to inject a service into the async validator.

One possible way to inject something inside our validator function is to wrap this function with a creator…

--

--