响应式表单动态增加字段后的validator

export type DisplayColTitle = {
    monyobi: string;
}
export type Yoteicontent = {
    deptId: string;
    yobiCd: string;
    ymdId: string;
    hidukeymd: string;
    accountId: string;
    yotesuu: string;
}

export class YoteiSeisan {
    deptId: string;
    yobiCd: string;
    hidukeymd: string;
    yotesuu: string;

    constructor(
        deptId: string,
        yobiCd: string,
        hidukeymd: string,
        yotesuu: string) {
        this.deptId = deptId;
        this.yobiCd = yobiCd;
        this.hidukeymd = hidukeymd;
        this.yotesuu = yotesuu;
      }
}
import { DatePipe } from '@angular/common';
import { Component, ElementRef, Input, OnInit, QueryList, ViewChildren } from '@angular/core';
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { DisplayColTitle, Yoteicontent, YoteiSeisan } from './definition';

@Component({
  selector: 'app-yotedata',
  templateUrl: './yotedata.component.html',
  styleUrls: ['./yotedata.component.scss'],
  providers: [DatePipe],
})
export class YotedataComponent implements OnInit {
  @ViewChildren('divId') divIdList?: QueryList<ElementRef>;
  @ViewChildren('inputId') inputIdList?: QueryList<ElementRef>;
  @ViewChildren('inputYmd') inputYmdList?: QueryList<ElementRef>;
  @ViewChildren('inputYobi') inputYobiList?: QueryList<ElementRef>;
  displaycolTitle: DisplayColTitle[] = [
    {monyobi:"月曜日"},
    {monyobi:"火曜日"},
    {monyobi:"水曜日"},
    {monyobi:"木曜日"},
    {monyobi:"金曜日"},
    {monyobi:"土曜日"},
    {monyobi:"日曜日"},   
  ];
  displayNum: Yoteicontent[] = [
    {deptId:'2',yobiCd:'5',ymdId:'5',hidukeymd:'20211001',accountId:'12', yotesuu:'6201'},
    {deptId:'2',yobiCd:'6',ymdId:'6',hidukeymd:'20211002',accountId:'13',yotesuu:'6202'},
    {deptId:'2',yobiCd:'7',ymdId:'7',hidukeymd:'20211003',accountId:'14',yotesuu:'6203'},
    {deptId:'2',yobiCd:'1',ymdId:'8',hidukeymd:'20211004',accountId:'22',yotesuu:'6204'},
    {deptId:'2',yobiCd:'2',ymdId:'9',hidukeymd:'20211005',accountId:'23',yotesuu:'6205'},
    {deptId:'2',yobiCd:'3',ymdId:'10',hidukeymd:'20211006',accountId:'24',yotesuu:'6206'},
    {deptId:'2',yobiCd:'4',ymdId:'11',hidukeymd:'20211007',accountId:'25',yotesuu:'6207'},
    {deptId:'2',yobiCd:'5',ymdId:'12',hidukeymd:'20211008',accountId:'26',yotesuu:'6208'},
    {deptId:'2',yobiCd:'6',ymdId:'13',h
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值