I'm currently in the process of developing a function within the constructor, and it is essential that this function be placed inside the constructor. I am interested in implementing a button to trigger this function from an external source, but unfortunately, I am unsure about the proper approach to achieve this.
Here is my TypeScript code snippet:
private internalFunction;
constructor(){
this.internalFunction = function greet(){
console.log('Greetings, world!');
};
}
}
buttonTrigger(event){
this.internalFunction.greet();
}