简体   繁体   English

如何禁用formFormGroup?

[英]How to disable form formGroup?

I need to use something like this: 我需要使用这样的东西:

<form [formGroup]="" [disabled]="func(formGroup, cond)">

And disable this: 并禁用此:

    funct(form, cond) {

      if (cond) {
          form.disable();
       }

     }

like suggested by @JB Nizet the disabled expects only a boolean value (true or false). 就像@JB Nizet所建议的那样,残疾人只期望布尔值(真或假)。 Upgrade your code with a variable 'cond' and if this is true you disable the form. 使用变量“ cond”升级代码,如果为true,则禁用表单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM