i am using Angular Bootstrap Modal Popup, here i want to show Maximize and Minimize options along with close button.
When we click on max, it has to expand full screen, when min is clicked, it has to be in default size mentioned when popup has got opened. is there any way to do this without using jquery?
openSm(content) {
this.modalService.open(content, { size: 'sm', windowClass: 'dark-modal' });
}
openLg(content) {
this.modalService.open(content, { size: 'lg', windowClass: 'light-modal' });
}
2
Answers
You can get it "playing" with css and use ngClass or class
If you enclosed your modal like
And use, e.g.
declare a variable maximize and your functions like
NOTE: before open the modal also change the variable maximize to false
NOTE2: you can put the code in your .html. Yours buttons like
So, here you have to use boolean variable & ngClass for adding CSS clases conditionally.
Please refer below,
TS file :
HTML file :
CSS File :