AngularJS: disabling all form controls between submit and server response

前端 未结 2 1256
我寻月下人不归
我寻月下人不归 2020-12-04 07:06

I have a dilemma about what is the best (and correct) approach if I want to disable form controls (or at least make them unavailable for user interaction) during a period of

2条回答
  •  借酒劲吻你
    2020-12-04 07:41

    Wrap all your fields in fieldset and use ngDisabled directive like this:

    ... inputs ...

    It will automatically disable all inputs inside the fieldset.

    Then in controller set $scope.isSaving to true before http call and to false after.

提交回复
热议问题