Я использую эту библиотеку https://github.com/dougludlow/ng2-bs3-modal, чтобы сделать модальности в угловом 2. Мне нужно для моего приложения модальное, но в отдельном компоненте. Пример:Как я могу сделать модальный как отдельный компонент в угловом 2?
a.component.html является представимыми с помощью кнопки:
<button type="button" class="btn btn-default" (click)="modal.open()">Open me!</button>
и b.component.html представлена модальных:
<modal #modal>
<modal-header>
<h4 class="modal-title">I'm a modal!</h4>
</modal-header>
<modal-body>
Hello World!
</modal-body>
<modal-footer>
<button type="button" class="btn btn-default" data-dismiss="modal" (click)="modal.dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="modal.close()">Ok</button>
</modal-footer>
</modal>
Что я должен написать в ts? Не могли бы вы помочь мне с plunkr? Спасибо :)
http://stackoverflow.com/questions/36566698/how-to -dynamically-create-bootstrap-modals-as-angular2-components – echonax