kirstein / angular-autodisable

ngAutodisable directive for angular. Automatic disable for buttons rocks!
http://jsfiddle.net/kirstein/wXnks/embedded/result/
MIT License
63 stars 26 forks source link

handling ng-disabled #26

Open lbesson opened 8 years ago

lbesson commented 8 years ago

One might want to disable / enable form inputs depending on some state. Currently, ng-autodisable and ng-disabled don't work well together, and we could have the situation where ng-autodisable has disabled an input, but a digest caused ng-disabled to reenable it while promise is not resolved yet.

Maybe there could be a simple / clever way to handle this.

lbesson commented 8 years ago

One "simple" way could be to be able to use syntax like ng-autodisable="expression" and make sure that button is disabled if expression false or promise pending

Would you be interested for such a feature.

Typical use case: I have a form with asynchronous submit, but I don't want to enable submit button if one required field is empty