Recently, I came across a function that looks like this:
if (form.valid) {
this.api.resetPassword(this.otpcode).subscribe(response => {
if (response.success) {
this.showToast(response.message);
this.router.navigateByUrl("/login");
}
if (response.error) {
this.showToast(response.error);
} else {
this.errors = response.errors;
}
});
}
}
However, when using VS Code, I encountered an error on the lines attempting to access the response properties such as response.success
. The error message states:
Property 'success' does not exist on type 'Object | any[]'.
Property 'success' does not exist on type 'Object'.ts(2339)
.
Initially, I assumed it was just an issue within VS Code, but even after running ionic cordova build, the same error persists in the console.