Just starting out with Angular 2, I've written the following code in my Angular project:
export class TestClass {
constructor() {
this.initMap();
}
initMap() {
this.marker.addListener('dragend', this.onMarkerDrop);
}
onMarkerDrop(event) {
this.functionTwo(); // I keep getting an error that says 'this.functionTwo' is not a function
}
functionTwo() {
}
}
Note: Before reaching out for help, I did some research on Stack Overflow and found these relevant links:
'this.function' is not a function - OO JS
this.function is not a function :typescript
Angular - this.function is not a function
Based on what I read, it seems like using arrow functions to call other member functions might be the solution. However, I'm unsure of how to implement their suggestions in my own code. Perhaps I misunderstood something.
I'm seeking guidance on how to properly call `this.functionTwo()` using an arrow function from `functionOne()`. Your assistance would be greatly appreciated.
Thank you for your support.