I have the following code:
module Dialog {
export class Modal {
static createAccessModal(link: Link) {
createModal(link);
}
static createAdminModal(link: Link) {
link.Modal.MaxHeight = 600;
link.Modal.Width = false;
createModal(link);
}
static private createModal(link: Link) {
...
}
}
}
I don’t want to be allowed to call createModal directly so I tried to make it private. When I use intellisense it shows up with a small lock symbol against it but then it doesn’t give any error when I use it. Is there some other way I could do this. Here is how I call the function:
Dialog.Modal.createAccessModal(link); // I want this to be allowed
Dialog.Modal.createModal(link); // I don't want this to be allowed
By the way I am using static functions for everything as these functions do nothing other than create objects on the screen and then the objects take care of themselves as they have their own submit button etc. Is this a reasonable thing to be doing?
1 Answer