以前,我曾使用Boolean属性来禁用复选框。
这是我到目前为止尝试过的。
app.component.ts
---------------
ReadOnly: boolean;
ngOnInit() {
this.ReadOnly = true;
}
app.component.htmt
------------------
<input type="checkbox" [disabled]="ReadOnly">
Run Code Online (Sandbox Code Playgroud)
{
"id":1,
"category":"cc",
"sortOrder":"1",
"active":"Y",
"Products":[
{
"id":100,
"backEndName":"DDA",
"sortOrder":"1",
"active":"N"
}
]
}
Run Code Online (Sandbox Code Playgroud)
现在我需要使用活动条件使字段禁用。我该怎么做?