title: Popover angular 2 ,bootstrap 4
body: <p><strong>I am Rendering the Below Text boxes Dynamically,I want to open popover for each text box and only one popover should be opened at a time.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/JGH4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGH4U.png" alt="enter image description here"></a></p>
  
  <p><strong>This is the markup for rendering the text boxes and the popover</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- for rendering dynamic fields --&gt;
  &lt;div&gt;
  &lt;div *ngFor="let field of fieldsInfo"&gt;
  &lt;div class="form-group"&gt;
     &lt;label class="required" for="field?.FieldName"&gt;{{field?.DisplayName}}&lt;/label&gt;
     &lt;input [type]="text" [id]="field?.FieldName" class="form-control" [formControlName]="field?.FieldName" [ngModel]="field?.Value" /&gt;
     &lt;template #popContent&gt;&lt;/template&gt;
     &lt;button type="button" id="{{field?.FieldName}}" class="btn btn-secondary" (click)="openPopover(field.FieldName)" [ngbPopover]="field?.FieldName" popoverTitle="Popover" #p="ngbPopover" placement="right" triggers="manual"&gt;open
     &lt;/button&gt;
   &lt;/div&gt;
   &lt;/div&gt;
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>This is the typescript code</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class PopoverComponent {
  
      @ViewChild('p') public popover: NgbPopover;
  
      openPopover(data: any){
          this.popover.open(data);
      }
      
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>The issue is when ever i hit any open button, only the popover of the first text box is being displayed and not able to open other popovers , can you tell me what code changes i have to make to make this functionality work</strong></p>