angular - 如何在 Angular for 循环中使用 Angular ngbootstrap 弹出框
问题描述
我正在使用 ngbPopover,如下所示
<ng-template #mytemp>
<my-editor></my-editor>
</ng-template>
<button type="button" class="btn" placement="bottom-left" [ngbPopover]="mytemp">
Show
</button>
但我想在 *ngfor 循环中使用它。
let items =[ { id:1, settings: "s1" }, { id:2, settings: "s2" }];
<div *ngFor="let item of items">
<ng-template #item.id>
<my-editor></my-editor>
</ng-template>
<button type="button" class="btn" placement="bottom-left" [ngbPopover]="item.id">
Show
</button>
</div>
但它没有用。
解决方案
推荐阅读
- postgresql - Postgres jsonb 索引格式
- jquery - 如何在鼠标位置上方显示“模态”?
- c++ - 如何在 C++ 中将字节写入文件?
- redirect - 有人可以在我部署的一个网站上帮助我,面临重定向警告并试图修复它无济于事
- node.js - 节点 - 使用 axios 执行 http 请求时收到 ECONNRESET 错误
- html - 如何在文本框中显示错误消息,除了角度 8 中的数字/数字之外的任何其他内容
- asp.net - ASP.NET Core - 在所有路由上提供 index.html 而无需重写 URL
- python - 注释 YAML 文件中现有的键值对
- racket - 如何在 Racket 的函数中重新分配变量?
- python - How to correct Python-Tensorflow has no attribute error ''getdlopenflags'?