forked from ng-bootstrap/ng-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close ng-bootstrap#1963
- Loading branch information
Showing
7 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
demo/src/app/components/modal/demos/dismissall/modal-dismissall.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ng-template #content let-c="close" let-d="dismiss"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title" id="modal-basic-title">Sample dialog</h4> | ||
<button type="button" class="close" aria-label="Close" (click)="d()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
This is a simple dialog. | ||
</div> | ||
</ng-template> | ||
|
||
<div class="modal-dismissall-always-visible"> | ||
<button class="btn btn-lg btn-outline-primary m-2" (click)="open(content)">Launch demo modal</button> | ||
<button class="btn btn-lg btn-outline-primary m-2" (click)="dismissAll()">Dismiss all</button> | ||
</div> | ||
<div class="modal-dismissall-space"></div> |
33 changes: 33 additions & 0 deletions
33
demo/src/app/components/modal/demos/dismissall/modal-dismissall.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
@Component({ | ||
selector: 'ngbd-modal-dismissall', | ||
templateUrl: './modal-dismissall.html', | ||
styles: [` | ||
.modal-dismissall-always-visible { | ||
position: absolute; | ||
z-index: 200000; | ||
background-color: white; | ||
border-radius: 5px; | ||
} | ||
.modal-dismissall-space { | ||
height: 100px; | ||
} | ||
`] | ||
}) | ||
export class NgbdModalDismissall { | ||
closeResult: string; | ||
|
||
constructor(private modalService: NgbModal) {} | ||
|
||
open(content) { | ||
this.modalService.open(content); | ||
} | ||
|
||
dismissAll() { | ||
this.modalService.dismissAll(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters