@@ -5,7 +5,7 @@ import { ModalModule } from "../";
55import { Component , Input , Inject } from "@angular/core" ;
66import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
77import { Modal , ModalService } from "../" ;
8- import { ModalButton , AlertModalType } from "./alert-modal.interface" ;
8+ import { ModalButton , AlertModalType , ModalButtonType } from "./alert-modal.interface" ;
99import { PlaceholderModule } from "./../placeholder/placeholder.module" ;
1010import { BaseModal } from "./base-modal.class" ;
1111import { ExperimentalComponenent } from "../../.storybook/experimental.component" ;
@@ -21,15 +21,34 @@ import { ExperimentalModule } from "../experimental.module";
2121 <p class="bx--modal-content__text">{{modalText}}</p>
2222 </section>
2323 <ibm-modal-footer>
24+ <button class="bx--btn bx--btn--secondary" (click)="showSecondaryModal()">Show Secondary Modal</button>
2425 <button class="bx--btn bx--btn--primary" modal-primary-focus (click)="closeModal()">Close</button>
2526 </ibm-modal-footer>
2627 </ibm-modal>
2728 `
2829} )
2930class SampleModal extends BaseModal {
30- constructor ( @Inject ( "modalText" ) public modalText ) {
31+ constructor (
32+ @Inject ( "modalText" ) public modalText ,
33+ protected modalService : ModalService ) {
3134 super ( ) ;
3235 }
36+
37+ showSecondaryModal ( ) {
38+ this . modalService . show ( {
39+ modalLabel : "Secondary header label" ,
40+ modalTitle : "Sample secondary modal works." ,
41+ modalContent : this . modalText ,
42+ buttons : [ {
43+ text : "Cancel" ,
44+ type : ModalButtonType . secondary
45+ } , {
46+ text : "OK" ,
47+ type : ModalButtonType . primary ,
48+ click : ( ) => alert ( "OK button clicked" )
49+ } ]
50+ } ) ;
51+ }
3352}
3453
3554@Component ( {
0 commit comments