@@ -6,19 +6,19 @@ import { NgbModal, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-
66 templateUrl : './modal.component.html'
77} )
88export class NgbdModalBasicComponent {
9- closeResult : string ;
9+ closeResult : string = '' ;
1010
1111 constructor ( private modalService : NgbModal ) { }
1212 // This is for the first modal
13- open1 ( content1 ) {
13+ open1 ( content1 : string ) {
1414 this . modalService . open ( content1 , { ariaLabelledBy : 'modal-basic-title' } ) . result . then ( ( result ) => {
1515 this . closeResult = `Closed with: ${ result } ` ;
1616 } , ( reason ) => {
1717 this . closeResult = `Dismissed ${ this . getDismissReason ( reason ) } ` ;
1818 } ) ;
1919 }
2020 // This is for the Second modal
21- open2 ( content2 ) {
21+ open2 ( content2 : string ) {
2222 this . modalService . open ( content2 , { ariaLabelledBy : 'modal-basic-title' } ) . result . then ( ( result ) => {
2323 this . closeResult = `Closed with: ${ result } ` ;
2424 } , ( reason ) => {
@@ -28,37 +28,37 @@ export class NgbdModalBasicComponent {
2828
2929 // This is for the Third varios modal options
3030
31- openBackDropCustomClass ( content3 ) {
31+ openBackDropCustomClass ( content3 : string ) {
3232 this . modalService . open ( content3 , { backdropClass : 'light-blue-backdrop' } ) ;
3333 }
3434
35- openWindowCustomClass ( content3 ) {
35+ openWindowCustomClass ( content3 : string ) {
3636 this . modalService . open ( content3 , { windowClass : 'dark-modal' } ) ;
3737 }
3838
39- openSm ( content3 ) {
39+ openSm ( content3 : string ) {
4040 this . modalService . open ( content3 , { size : 'sm' } ) ;
4141 }
4242
43- openLg ( content3 ) {
43+ openLg ( content3 : string ) {
4444 this . modalService . open ( content3 , { size : 'lg' } ) ;
4545 }
4646
47- openVerticallyCentered ( content3 ) {
47+ openVerticallyCentered ( content3 : string ) {
4848 this . modalService . open ( content3 , { centered : true } ) ;
4949 }
5050
51- openstackmodal ( contentstack ) {
51+ openstackmodal ( contentstack : string ) {
5252 this . modalService . open ( contentstack , { size : 'lg' } ) ;
5353 }
5454
5555
56- opensubmodal ( contentsubmodal ) {
56+ opensubmodal ( contentsubmodal : string ) {
5757 this . modalService . open ( contentsubmodal , { size : 'lg' } ) ;
5858 }
5959
6060
61- private getDismissReason ( reason : any ) : string {
61+ private getDismissReason ( reason : ModalDismissReasons ) : string {
6262 if ( reason === ModalDismissReasons . ESC ) {
6363 return 'by pressing ESC' ;
6464 } else if ( reason === ModalDismissReasons . BACKDROP_CLICK ) {
0 commit comments