How to deal with double submit in Angular2

前端 未结 6 954
囚心锁ツ
囚心锁ツ 2021-02-02 11:30

If I click fast on my submit-button the form is submitted two or more times. My thought was to prevent this with the disabled attribute, but I need variable disableButon

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 12:26

    As you are already doing disableButton = true in submit call, you can do check disableButton before calling submit method.

    Template

    <--! Some Inputs -->

提交回复
热议问题