在ngfor

时间:2019-07-23 19:06:17

标签: angular bootstrap-4 popover ng-bootstrap

嘿,我正在尝试动态创建引导弹出按钮

  

在这里,我添加了ind来创建不同的popover对象,但事实并非如此   创建#p {{ind}} =“ ngbPopover”作为对象,并在我将该对象传递给我时
  函数参数我在ts文件中得到一个字符串。

     

如果我将#p {{ind}} =“ ngbPopover”替换为#p1 =“ ngbPopover”并通过   toggleWithComponent(p1,'c'+ ind)然后我在ts>文件中获取弹出对象。

  <div *ngFor="let data of initialpanelDashboardInteriorInspection; let ind = index">
    <div class="img-overlay-{{ind + 1}} img-overlay">
       <button class="success-round-button round-button c{{ind}}" popoverClass="my-popvover-class" placement="bottom"
                [autoClose]="false" [ngbPopover]="popContent" [popoverTitle]="popTitle" triggers="manual"
                #p{{ind}}="ngbPopover" (click)="toggleWithComponent('p'+ind, 'c'+ind)">{{ind + 1}}</button>
    </div>
  </div>

0 个答案:

没有答案