I've built a custom password validator for a template driven form based on this tutorial: https://juristr.com/blog/2016/11/ng2-template-driven-form-validators/#building-a-custom-validator
However, I'd like to use it on multiple forms which are in different parts in the application. I keep getting the error:
Type PasswordValidator is part of the declarations of 2 modules:
SignupModule and AuthModule! Please consider moving PasswordValidator to a higher module that imports SignupModule and AuthModule.
If I add the validator to the higher module like it suggests, it doesn't work anymore. The validator is never reached. It seems to need to be imported in the module directly holding the form to be effective.
Any ideas?
PasswordValidatorfrom both i.e.SignupModule and AuthModuleinstead add it in root module so that you can use it in entire application - Suryan