angular - 如何在角度 7 的页面加载上打开 ng-bootstrap 模式弹出窗口?
问题描述
我无法在 Angular 7 页面加载时显示 ng-bootstrap 模式弹出窗口。
我试过下面的代码来打开它。
openVerticallyCentered(content) {
this.modalService.open(content, { centered: true });.
this.modalService.open(content, { beforeDismiss: false });
}
解决方案
您应该使用 ViewChild 装饰器来访问 init 上的内容。
演示在这里。 https://stackblitz.com/edit/angular-rd8tny?embed=1&file=app/modal-basic.ts
推荐阅读
- spring - 尝试使用 Spring JPA 发送带有外键的 JSON 对象的 POST 请求时出现重复或 Null 错误
- python - 屏幕抓取特定问题
- amazon-s3 - PySpark 将 str 转换为 TimestampType
- flutter - Flutter:设置 WebView Cookie
- sql - bcp 查询出 XML 文件格式问题
- php - 正则表达式:带排除的点包括排除的字符
- java - max_allowed_packet 变量更改未解析 Packet for query is too large 错误
- mysql - 如何将 JSON_REMOVE 与子查询中的多行一起使用?
- django - 子查询中的 django 过滤器 raise '表达式包含混合类型。您必须设置 output_field' 错误
- asp.net-mvc - 从购物车结账时减少商品数量 - ASP.NET MVC