首页 > 解决方案 > 模态自动关闭 - Angular

问题描述

  <div class="row-4">
     <button (click)="open(content)">Open modal</button>
     <ng-template #content>
     <p>HI</p>
     </ng-template>              
     </div>

 open(template: TemplateRef<any>) {
    this.modalRef = this.modalService.show(template, { class: 'modal-sm' });
  }

显示模式 1 秒后,它会将我重定向到另一个视图。

标签: angular

解决方案


推荐阅读