How to use code to open a modal in Angular 2?

前端 未结 14 2977
天涯浪人
天涯浪人 2020-12-05 04:34

Usually we use data-target=\"#myModal\" in the

14条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 04:49

    I am using a variable to control show and hide and rely on the button the open the modal

    ts code:

    showModel(){
      this.showModal = true;
    }
    

    html:

提交回复
热议问题