angular-formly - 如何聚焦在 ngx-formly 中另一个字段的 fieldGroup 内配置的字段?
问题描述
export class AppComponent {
form = new FormGroup({});
model = {
investments: [{}, {}],
};
options: FormlyFormOptions = {};
fields: FormlyFieldConfig[] = [
{
key: 'investments',
type: 'repeat',
fieldArray: {
fieldGroupClassName: 'row',
templateOptions: {
btnText: 'Add another investment',
},
fieldGroup: [
{
type: 'input',
key: 'investmentName',
templateOptions: {
label: 'Name of Investment:',
required: true,
},
}
],
},
},
];
现在将生成 2 个输入字段如何将第二个字段集中在某个方法上?在运行时将字段集中在某些操作上的最佳方法是什么?
解决方案
推荐阅读
- c++ - 声明头文件后的 C++ 无法识别我的结构
- c# - For 循环或 out 中的声明变量有什么不同?
- android - Android EditText 协程去抖操作符,如 RxJava
- flutter - 颤振:引发了另一个异常:在尝试获取 SharedPreference 实例时,在构建期间调用了 setState() 或 markNeedsBuild()
- avr - 进行软件保护时应该如何设置位?
- python-3.x - 通过查找相似的字符串来填充空值,pandas
- webpack - Webpack 为什么只有 scss 有效,而 css 无效?
- javascript - 启动大文件上传时如何防止node.js挂起?
- html - 样式 html5 音频播放器
- rust - 为什么 rust 在应该 bool 时会期望 ()?