Close bootstrap modal using typescript in angular 2

前端 未结 3 2172
深忆病人
深忆病人 2021-02-20 12:47

I have a button, on the click of which I am opening a bootstrap modal pop-up. The modal pop-up contains some field with a submit button. I want to close the pop-up only when I a

3条回答
  •  名媛妹妹
    2021-02-20 13:29

    With your id="AddExpense", you can close the modal with the below code anywhere in your typescript.

    document.getElementById('AddExpense').click(); // where you want to dismiss your modal

提交回复
热议问题