I have a modal which has a form. At a point I need to show another modal for user to select items and update the view of first modal with the selected items . How can I do that. I have to show both modals at the same time.
Below is my code snippets ..
<button class="btn btn-primary btn-xs" (click)="openContactModal()">Add
Contact</button>
<modal #myModal
modalClass="modal-md"
[closeOnEscape]="false"
[closeOnOutsideClick]="false"
[hideCloseButton]="true"
>
<modal-header>
<h6>Contact</h6>
</modal-header>
<modal-content>
<button class="btn btn-primary btn-xs" (click)="openContactModal2()">TestModal2</button>
</modal-content>
<modal #myModal2
modalClass="modal-md"
[closeOnEscape]="false"
[closeOnOutsideClick]="false"
<modal-content>
<ul *ngFor="let type of types">
<li>{{type}}</li>
</ul>
<p> I am in modal two and I will select types though they are list here</p>
the selcected types should be seen in other modal
My components does open both modal from code as:
@ViewChild('myModal') myModal: Modal;
@ViewChild('myModal2') myModal2: Modal;
openContactModal() {
this.myModal.open();
}
openContactModal2(types) {
this.myModal2.open(types);
}
The problem is once I open modal 2 , 1 gets closed. I got some solution with jquery to fix that in this. But I am not sure about implementing in angular 2. Is there any easy solution for this. Sorry to provide incomplete code as I can't do.