I am using this library https://github.com/dougludlow/ng2-bs3-modal to make modals in angular 2. I need for my application the modal but in a separate component. Example :
a.component.html is representated by the button :
<button type="button" class="btn btn-default" (click)="modal.open()">Open me!</button>
and the b.component.html is represented by the modal:
<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>
What should I write in the ts? can you please help me with a plunkr? Thanks :)