I
I
Ivan Stroykin2017-01-17 16:55:59
Angular
Ivan Stroykin, 2017-01-17 16:55:59

What could be causing ng2-bootstrap modals to fail?

Good day,
there was a problem with ng2-bootstrap, namely with model windows. Collapse, alert and others work (I didn't check everything), but modal doesn't work.
I use the example on off.site:

<button type="button" class="btn btn-primary" (click)="staticModal.show()">Static modal</button>
 
<div class="modal fade" bsModal #staticModal="bs-modal" [config]="{backdrop: 'static'}"
     tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title pull-left">Static modal</h4>
        <button type="button" class="close pull-right" aria-label="Close" (click)="staticModal.hide()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        This is static modal, backdrop click will not close it.
        Click <b>&times;</b> to close modal.
      </div>
    </div>
  </div>
</div>

But when I click on the button, I get errors:
caused by: ApplicationRef instance not found
ApplicationRef instance not found

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Stroykin, 2017-01-17
@StivinKing

A. I don't know if this is the correct solution? Link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question