如何禁用按钮,直到表单字段保持不变?

时间:2019-12-24 14:08:14

标签: angular

我要禁用“提交”按钮,直到用户更改任何字段。 我已经尝试过了:

 <input type="submit" value="Update Profile" [disabled]="!updateForm.dirty || !updateForm.touched">

请帮助...

1 个答案:

答案 0 :(得分:0)

<input type="submit" value="Update Profile" [disabled]="!updateForm.valid">

尝试这个希望能奏效!