title: Trouble using multiple bootstrap modals (ngx-bootstrap and Angular)
body: <p>I really have a problem using multiple bootstrap modals within Angular 4. Maybe you can help me out of this. The code is working fine with just one modal. I am not be able to use the buttons/form of the first loaded modal. The second is working fine. After opening and closing the second modal, also the first modal works... strange. Is there something wrong?  </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;!-- ADD MODAL--&gt;
  &lt;div bsModal #addModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myAddModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;h4 class="modal-title"&gt;Add Dimension&lt;/h4&gt;
          &lt;button type="button" class="close" (click)="addModal.hide()" aria-label="Close"&gt;
            &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;form&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput"&gt;TAG&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput" placeholder="Example input" aria-describedby="keyHelp"
                value="" disabled&gt;
              &lt;small id="keyHelp" class="form-text text-muted"&gt;Notice that this field is a surrogate key!&lt;/small&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput2"&gt;Name&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input" value=""&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput3"&gt;Description&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input" value=""&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" id="dfsdfsdfsdf" class="btn btn-secondary" (click)="addModal.hide()"&gt;Close&lt;/button&gt;
          &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- EDIT MODAL--&gt;
  &lt;div bsModal #editModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog" role="document"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;h4 class="modal-title"&gt;Edit {{currentItem?.NAME}}&lt;/h4&gt;
          &lt;button type="button" class="close" (click)="editModal.hide()" aria-label="Close"&gt;
            &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;form&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput"&gt;TAG&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput" placeholder="Example input" aria-describedby="keyHelp"
                value="{{currentItem?.TAG}}" disabled&gt;
              &lt;small id="keyHelp" class="form-text text-muted"&gt;You'll need to delete this entry to change this key value!&lt;/small&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput2"&gt;Name&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input" value="{{currentItem?.NAME}}"&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;label for="formGroupInput3"&gt;Description&lt;/label&gt;
              &lt;input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input" value="{{currentItem?.COMM}}"&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-secondary" (click)="editModal.hide()"&gt;Close&lt;/button&gt;
          &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </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>import { Component, OnInit, ViewChild } from '@angular/core';
  import { DataService } from "../data.service";
  import { ModalDirective } from 'ngx-bootstrap/modal/modal.component';
  
  @Component({
  
    templateUrl: './dimensions.component.html',
    styleUrls: ['./dimensions.component.scss']
  })
  export class DimensionsComponent implements OnInit {
  
    @ViewChild('editModal') public editModal: ModalDirective;
    @ViewChild('addModal') public addModal: ModalDirective;
    currentItem;
  
    openModal(item: any) {
      this.currentItem = item;
      this.editModal.show();
  
    }
  
  
    openAddModal() {
      this.addModal.show();
  
    }
  
  
    //Attributes
    public currentVar;
    subscription;
    dimensionData;
    rows;
  
    constructor(private _dataService: DataService) {
  
  
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank you for your time guys!</p>
  
  <p>Update: By switching the modal sequence inside the code the problem also occures but just in terms of the other modal. </p>