I have a custom modal component
which is responsible to display overlay(modal-popup) which contains carousel.
Problem : As you can see in below code, outer div contains (click)
event to close the overlay (I dont have Header part in overlay
).
<div class="modal fade" id="myModal" (click)="hide($event)">
...
...
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="sr-only">next</span>
</a>
</div>
So when I click a tag
, it hides overlay too. If I remove click event, carousel works fine.
To solve the problem, I've attached (click)="stoppropogation($event);false"
to a tag
to stop event propagation. Now clicking a tag
doesn't hide overlay but it doesn't even show next picture.
Here is my code,
<div class="modal fade" id="myModal" (click)="hide($event)">
...
...
<a (click)="stoppropogation($event);false" id="next" role="button" data-slide="next">
<span class="sr-only">Next</span>
</a>
</div>
stoppropogation(event:any){
event.stopPropagation();
document.getElementById("next").href="#myCarousel";
}
Any easy solution?