Checkbox angular material checked by default

前端 未结 11 2384
傲寒
傲寒 2021-02-11 19:37

I am trying to use an Angular Material checkbox, and set it by default as checked, but it is displayed as non-checked, what is wrong?



        
11条回答
  •  无人共我
    2021-02-11 20:11

    Set this in HTML:

        
    

    Changes in Ts file

    this.Form = this.formBuilder.group({
    a: false,
    b: false,
    c: false,
    d: false,
    e: false,
    });
    

    Conditionvalidation in Ur Business logic

    if(true){
    this.Form.patch(a: true);
    }
    

提交回复
热议问题