How to make 'submit' button disabled? Ask Question

How to make 'submit' button disabled? Ask Question

How to disable the "Submit" button until the form is valid?

Does angular2 have an equivalent to ng-disabled that can be used on the Submit button? (ng-disabled doesn't work for me.)

ベストアンサー1

As seen in this Angular example, there is a way to disable a button until the whole form is valid:

<button type="submit" [disabled]="!ngForm.valid">Submit</button>

おすすめ記事