- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用一个片段来交互 formGroup 中的所有表单控件。该代码段一开始运行良好,但突然间 angular 开始提示
Object.keys(this.frmCadastroImobiliaria.controls).forEach(key => {
const fc: FormControl = this.frmCadastroImobiliaria.get(key); //here I got an error
if(fc.touched === true) {
fcs.push(fc);
}
});
Type 'AbstractControl' is missing the following properties from type 'FormControl': registerOnChange, registerOnDisabledChange, _applyFormState
最佳答案
您可以使用 typescript 断言( as
)。
const fc: FormControl = this.frmCadastroImobiliaria.get(key) as FormControl;
关于Angular: 'AbstractControl' 缺少类型 'FormControl' 的以下属性: registerOnChange、registerOnDisabledChange、_applyFormState,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59569983/
我正在使用 angular rc4 版本来编写一个应用程序,在该应用程序中我必须强加一些验证规则来形成像 required 这样的组件。 , minlength以及一些自定义验证器 emailVali
我已经构建了一个表单,我在其中实现了表单验证,当用户将电子邮件或密码字段留空时,该表单仅显示一条错误消息。它工作正常,但我的问题是我将电子邮件和密码设置为“AbstractControl”而不是“St
我的错误页面没有按计划工作。我在我的 Application Module 中创建了一个事件与 onBootstrap处理填充我的设计 Assets 的方法。 它适用于所有页面,除了路由不匹配的页面我
我想在 Angular7 中构建表单数组 控件带有红色下划线。我什至在提供应用程序之前就遇到了这个错误: Property 'controls' does not exist on type 'Abs
我有以下代码: unless Rails.application.config.consider_all_requests_local rescue_from Exception, with: :
当我在用户 Controller 中调用此销毁方法时,出现以下错误。 AbstractController::DoubleRenderError (Render and/or redirect wer
我遇到了一个非常奇怪的路由错误,在 Rails 3.2.11 中我似乎无法解决该错误 错误是:AbstractController::ActionNotFound(无法为 SubmissionsCon
我必须从验证器指令内部触发验证。 这是我的指令。它按预期工作。但是我希望它在验证器函数更改时触发验证过程。 IE。当它的输入变量 maxDate 改变时。 我该怎么做? 如果我可以在构造函数中访问 A
当我尝试使用带有控件的表单时,出现此错误。 Type 'AbstractControl' is missing the following properties from type 'FormCon
我有这个自定义组件: 这里,控制定义为: @Input() control: FormControl; 我的组件的用法: this.myFormGroup = new FormGroup({
我遇到了一个双重渲染错误,我无法在模型的更新方法中摆脱它。 这是 Controller 的代码 class Admin::CmsHappeningNowFeatureController index
(Rails 3.0.7) 我的routes.rb有这个: namespace :admin do namespace :campus_hub do resources :billing_
我在 src/groovy/ssh 中有一个 AbstractController public void listAjax(){ //do sth } 然后创建 Controller syst
我遇到了一个双重渲染错误,我无法在模型的更新方法中摆脱它。 这是 Controller 的代码 class Admin::CmsHappeningNowFeatureController index
我有一个嵌套的 FormGroup,如下所示: this.formGroup: FormGroup: { // ... controls: { "GENERAL_AND
我正在 Angular 中进行表单验证,在阅读 API 时遇到了 nullValidator .它说它是一个“不执行任何操作的验证器”,这在我看来就像是一个实际上什么都不做的验证器。当我检查 code
已经针对此错误发布了很多博客,但没有针对 angular4 指定任何博客。 我在表单上添加和删除动态控件 在初始化期间向窗体添加控件 ngOnInit() { this
我正在学习在线类(class),但我有很多问题。 我取决于我把我的代码我得到 type 'abstractcontrol' is missing the following properties fr
今天,当我尝试为用户 Controller 使用一些辅助方法时,出现了此错误: AbstractController::DoubleRenderError (Render and/or redirec
我想为 select 元素中的每个选项元素创建一个自定义属性,但在创建可通过 AbstractControl 和 event.target 访问的属性时遇到问题。这是我所拥有的: 我尝试创建一个名为
我是一名优秀的程序员,十分优秀!