I am using the ngx-smart-modal and it is working fine but the problem is that I want to disable it closing when a click is initiate outside the modal or in the body.
<button class="btn btn-primary" (click)="ngxSmartModalService.getModal('classicModalregister').open()">Register</button>
<ngx-smart-modal #popupRegister [identifier]="'classicModalregister'" customClass="medium-modal">
<h1>Register Here !</h1>
<p>dfdfd</p>
</ngx-smart-modal>
Following the documentation we can set parameter/option on ngx-smart-modal
tag as the dismissable
, the parameter that allow to close or not at outside click.
So we got [dismissable] = "false"
The fix:
<button class="btn btn-primary" (click)="ngxSmartModalService.getModal('classicModalregister').open()">Register</button> <ngx-smart-modal #popupRegister [identifier]="'classicModalregister'" customClass="medium-modal" [dismissable] = "false"> <h1>Register Here !</h1> <p>dfdfd</p> </ngx-smart-modal>
Remember: Always read the documentation!
Documentation: https://www.npmjs.com/package/ngx-smart-modal
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.