Here is my code snippet:
export class TestComponent implements OnInit {
constructor() { }
ngOnInit() {
FB.getLoginStatus(function (response) {
this.ParseFacebookLoginStatus(response);
});
}
ParseFacebookLoginStatus(response) {
console.log(response.status);
}
The error message in my console states:
ERROR TypeError: this.ParseFacebookLoginStatus is not a function
.
It seems like the issue might be related to the asynchronous nature of getLoginStatus and the context of 'this' not referencing my TestComponent. How can I properly handle this callback and return to my TestComponent?