Angular 动态属性绑定
When the expression resolves to null or undefined, Angular removes the attribute altogether.
方法1 - html:
方法2 - formGroup:
if (this.readOnly) {
this.formGroup.get('name').disable();
}

Angular 动态属性绑定
When the expression resolves to null or undefined, Angular removes the attribute altogether.
方法1 - html:
方法2 - formGroup:
if (this.readOnly) {
this.formGroup.get('name').disable();
}