There is a separate object responsible for managing a specific dialog box in my application. The challenge lies in accessing the instance of the class, even though the functions are self-explanatory. I attempted to use the conventional method of that = this
but to no avail.
export class Whatever implements OnInit {
that = this;
dialog = {
data:{},
open:function() {
//need a way to access 'that' variable
},
close:function() {},
toggle:function() {}
}
//other declarations and functions
}
With my application growing in scale, I am finding an abundance of functions within this service. Therefore, I am exploring the option of consolidating some functions into objects, which will enhance the overall code quality.
If there are alternative methods or suggestions for improving this situation, I would greatly appreciate any insights. Thank you.