Reputation: 99
I am using ngx-bootsrap popover in angular 5. It's working fine when clicking the div tag, how can I activate the popover using *ngIf
?
I tried using *ngIf
this way but it's not working:
<div *ngIf="true"
popover="today is very bad day"
placement="right"> Popover on right
</div>
Any help and/or suggestions will be appreciated!
Upvotes: 0
Views: 1909
Reputation: 91
popover is a directive which will impact an element like button, div etc. If you are trying to use *ngIf then you are trying to impact the element not the directive.
But if you are trying to disable popover on certain condition, then use isOpen property of popover and keep it's value false. your popover will not appear.
checkout the exact example for your need https://valor-software.com/ngx-bootstrap/#/popover#trigger-by-isopen-property
and as others have mentioned if you share your code then it will be helpful to provide more accurate answer.
Upvotes: 2