相关疑难解决方法(0)

ngFor(Angular 2)中的动态模板引用变量

如何在元素中声明动态 模板引用变量ngFor

我想使用ng-bootstrap中的popover组件,popover代码(带有Html绑定)如下所示:

<ng-template #popContent>Hello, <b>{{name}}</b>!</ng-template>
    <button type="button" class="btn btn-secondary" [ngbPopover]="popContent" popoverTitle="Fancy content">
    I've got markup and bindings in my popover!
</button>
Run Code Online (Sandbox Code Playgroud)

如何这些元素包装在里面ngFor

<div *ngFor="let member of members">
    <!-- how to declare the '????' -->
    <ng-template #????>Hello, <b>{{member.name}}</b>!</ng-template>
        <button type="button" class="btn btn-secondary" [ngbPopover]="????" popoverTitle="Fancy content">
        I've got markup and bindings in my popover!
    </button>
</div>
Run Code Online (Sandbox Code Playgroud)

嗯......任何想法?

angular-template ng-bootstrap angular

56
推荐指数
2
解决办法
3万
查看次数

标签 统计

angular ×1

angular-template ×1

ng-bootstrap ×1