1

我在我的项目(Angular 11)中安装了一个包“ngx-custom-validator”,它工作正常。

将项目升级到 Angular 12 后,现在我面临“ngx-custom-validator”的问题

以下错误:

_Namespace '"***/node_modules/ngx-custom-validators/node_modules/@angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.

4257 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<ɵInternalFormsSharedModule, [typeof ɵNgNoValidate, typeof NgSelectOption, typeof ɵNgSelectMultipleOption, typeof DefaultValueAccessor,typeof NumberValueAccessor, typeof RangeValueAccessor, typeof CheckboxControlValueAccessor, typeof SelectControlValueAccessor, typeof SelectMultipleControlValueAccessor, typeof RadioControlValueAccessor, typeof NgControlStatus, typeof NgControlStatusGroup, typeof RequiredValidator, typeof MinLengthValidator, typeof MaxLengthValidator, typeof PatternValidator, typeof CheckboxRequiredValidator, typeof EmailValidator], never, [typeof ɵNgNoValidate, typeof NgSelectOption, typeof ɵNgSelectMultipleOption, typeof DefaultValueAccessor, typeof NumberValueAccessor, typeof RangeValueAccessor, typeof CheckboxControlValueAccessor, typeof SelectControlValueAccessor, typeof SelectMultipleControlValueAccessor, typeof RadioControlValueAccessor, typeof NgControlStatus, typeof NgControlStatusGroup, typeof RequiredValidator, typeof MinLengthValidator, typeof MaxLengthValidator, typeof PatternValidator, typeof CheckboxRequiredValidator, typeofEmailValidator]>;

我想最近使用这个包的开发者也有这个问题,如果有任何解决方案请分享。

预先感谢

4

3 回答 3

4

使用版本:“ngx-custom-validators”:“8.0.0”

它对我有用。

于 2021-08-11T17:19:10.040 回答
1

它与https://github.com/rsaenen/ngx-custom-validators相关。

它应该更新到 Angular 12。

有一个修复问题的拉取请求,但它已经很长时间没有应用了。我创建了我的包来使用它

https://www.npmjs.com/package/@narik/custom-validators

于 2021-08-12T03:23:38.797 回答
0

您现在面临的问题与 ngx-custom-validators lib 内部相关。我建议您在此处关注此问题https://github.com/rsaenen/ngx-custom-validators/issues/60 以获得修复或解决方法。

于 2021-07-02T06:00:18.787 回答