【问题标题】:How to open ng-bootstrap modal popup on pageload in angular 7?如何在 Angular 7 中打开页面加载时的 ng-bootstrap 模式弹出窗口?
【发布时间】:2019-06-18 10:22:56
【问题描述】:

我无法在 Angular 7 页面加载时显示 ng-bootstrap 模式弹出窗口。

我试过下面的代码来打开它。

openVerticallyCentered(content) {

this.modalService.open(content, { centered: true });.
this.modalService.open(content, { beforeDismiss: false });

}

【问题讨论】:

标签: angular bootstrap-modal ng-bootstrap modalpopup


【解决方案1】:

您应该使用 ViewChild 装饰器在初始化时访问内容。

演示在这里。 https://stackblitz.com/edit/angular-rd8tny?embed=1&file=app/modal-basic.ts

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-12
    • 1970-01-01
    • 2017-08-24
    • 2014-08-29
    • 1970-01-01
    • 1970-01-01
    • 2019-08-09
    • 2016-05-25
    相关资源
    最近更新 更多