@@ -11,14 +11,14 @@ export const ModalSize = {
1111} ;
1212
1313// Stores a basic set of configuration options for a modal.
14- export class ModalConfig < T , U = null , V = null > {
14+ export class ModalConfig < T , U = undefined , V = undefined > {
1515 // Determines whether the modal can be closed with a close button, clicking outside, or the escape key.
1616 public isClosable :boolean ;
1717 // Value to deny with when closing via `isClosable`.
1818 public closeResult :V ;
1919
2020 // Data to pass to the modal instance when opened.
21- public context :T ;
21+ public context ? :T ;
2222
2323 // Size used to display the modal.
2424 public size :ModalSize ;
@@ -35,7 +35,7 @@ export class ModalConfig<T, U = null, V = null> {
3535 // Duration of the modal & dimmer transitions.
3636 public transitionDuration :number ;
3737
38- constructor ( context :T = null , isClosable :boolean = true ) {
38+ constructor ( context :T | undefined = undefined , isClosable :boolean = true ) {
3939 // Initialise with default values.
4040 this . isClosable = isClosable ;
4141 this . context = context ;
@@ -52,21 +52,21 @@ export class ModalConfig<T, U = null, V = null> {
5252}
5353
5454// Used when creating a modal from a `TemplateRef`.
55- export class TemplateModalConfig < T , U = null , V = null > extends ModalConfig < T , U , V > {
55+ export class TemplateModalConfig < T , U = undefined , V = undefined > extends ModalConfig < T , U , V > {
5656 public template :ModalTemplate < T , U , V > ;
5757
58- constructor ( template :ModalTemplate < T , U , V > , context :T = null , isClosable :boolean = true ) {
58+ constructor ( template :ModalTemplate < T , U , V > , context :T | undefined = undefined , isClosable :boolean = true ) {
5959 super ( context , isClosable ) ;
6060
6161 this . template = template ;
6262 }
6363}
6464
6565// Used when creating a modal from an existing component.
66- export class ComponentModalConfig < T , U = null , V = null > extends ModalConfig < T , U , V > {
66+ export class ComponentModalConfig < T , U = undefined , V = undefined > extends ModalConfig < T , U , V > {
6767 public component :Function ;
6868
69- constructor ( component :Function , context :T = null , isClosable :boolean = true ) {
69+ constructor ( component :Function , context :T | undefined = undefined , isClosable :boolean = true ) {
7070 super ( context , isClosable ) ;
7171
7272 this . component = component ;
0 commit comments