I have used the component (with ng-block-ui integrated) in a page component. It fires both the block-ui event if I click to any one.
I want to block the UI of that specific card which I clicked.
On
You can use a CSS based approach to block individual card UI.
Use the card-blocker class to your card and it will create a UI blocker on the top of the card making it inaccessible.
<div class="card card-blocker" (click)="onClick($event)">
// card body
<div>
.card-blocker::after {
content: '';
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9999;
background: rgba(192,192,192,0.1);
}
Also if you want to explicitly prevent any click event, use the method in your component side:
onClick(e: Event): void {
if ((e.target as HTMLElement).classList.contains('card-blocker')) {
return;
}
// your logic for card click
}
I found the answer!! to this problem.
SEE IMAGE FOR MORE REFERENCE