【发布时间】:2020-12-03 22:33:01
【问题描述】:
我想为非表单控件使用反应式表单组来验证表单。我在表单中使用了一些自定义组件。请看示例
<form [formGroup]='formGroupName' >
<input type='text' formControlName='control1'/>
<!--The below component is part of some node module I cant do any changes in the below component -->
<some-component [(value)]='model'></some-component>
</form>
TypeScript
this._fb.group({
control1: ['', [Validators.required]],
control2: ['', [Validators.required]]
});
在上面的代码中,我想将 control2 绑定到 some component 模型
【问题讨论】:
标签: javascript angular angular-forms angular-formbuilder