shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 242 forks source link

Custom Modal Size #326

Open zerox12311 opened 7 years ago

zerox12311 commented 7 years ago

[ ] bug report [ ] feature request [*] question about the decisions made in the repository

Excuse me , how can i use Components as content in this library I had tried the Custom Modal example , but I can't change the Modal size

I want to use this like ng-bootstrap modal but i don't how to do....

Please help me....thanks

lpikora commented 7 years ago

just add modal-sm (small) or custom class to dialog element classes using property this.context.dialogClass eg:

constructor(public dialog: DialogRef<CustomModalContext>) {
    this.context = dialog.context;
    this.context.dialogClass = 'modal-dialog modal-sm';
}
puneethrai commented 6 years ago

for me, the above solution didn't work. Since it prevented rendering the modal. So instead of adding class to context's dialogClass, I modified the template like this

<div class="modal show" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
            </div>
            <div class="modal-body">
            </div>
            <div class="modal-footer">
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>