How to Validate FormArray length in angular2

后端 未结 6 1552
猫巷女王i
猫巷女王i 2021-02-02 09:16

I have a data driven form in angular2 like below

this.formBuilder.group({
  \'name\': [\'\',Validators.required],
  \'description\': [\'\', Validators.required],         


        
6条回答
  •  死守一世寂寞
    2021-02-02 10:04

    Having a template

    [...]

    You could simply use this in your button :

    [disabled]="!myForm.get('items.1')"
    

提交回复
热议问题