我的目标是从Excel中复制值,并以准确的顺序将它们输出到HTML表中。
Excel假人的结构如下:
测试数据
为此,我已经实现了以下代码:
// HTML
...
<label>
<input style="background-color: silver" type="text
[formControl]="rowControl.get(column.attribute)"
(paste)="pasteExcelData($event)" // Use here the
我有一个工作坊编辑组件(按顺序排列):
构建表单检索工作坊,用工作坊值编辑更新表单值
以下是代码:
ngOnInit() {
this.buildForms();
this.initialize();
}
async initialize(): Promise<void> {
const id = this.route.snapshot.params.id;
this.workshop = await this.workshopService.find(id); // in real this is in a trycatch block
this.upda
我将填充如下所示的customerNumberContainers:
this.form = new FormGroup({
customerNumberContainers: new FormArray([
new FormGroup({
contactTenant: new FormControl('', [Validators.required, Validators.minLength(2)]),
customerNumber: new FormControl('', [Validators.r
我有一个带有FormAwway的表单,其中显示了所购买的产品,这是我的组件: constructor() {
this.purchaseForm = new FormGroup({
id: new FormControl(null, Validators.required),
purchase: new FormControl(null, Validators.required),
date: new FormControl(null, Validators.required),
products: new FormAr
我希望在用户在空创建的控件中添加值之后更新formArray。
目前,当用户选择添加一个新项时,我会使用空值将其构建到formArray上。
buildItem(item?: any, key?: any): FormGroup {
// Item will pass undefined for initial buildItem in onLoad and new items
let itemName: string;
let keyValue: string;
if (item === undefined) {
itemName = ''; ke
我得到了这个错误:
ERROR Error: Uncaught (in promise): TypeError: value.forEach is not a function
TypeError: value.forEach is not a function
at FormArray.patchValue.
我从Laravel获得数据,我希望这些数据显示在一个FormArray中。
我的代码如下所示:
this.http.get("http://data_dink" + '/' + event.value)
.toPromise().then(da
我已经编写了一个对话框,其中包含要从表中删除的所有选定行。现在,当我提交对话框时,我希望激活的复选框也被取消选中。 解决这个问题的最佳方法是什么? 我的代码: // HTML
<mat-checkbox (click)="toggleCheckboxes()"></mat-checkbox> // TS
private all = false;
public toggleCheckboxes() {
this.all = !this.all;
for (const formGroup of this.rows.controls)