I have encountered an issue with my code in Angular 2. It works fine in that framework, but when I tried using it in a Nativescript project, it failed to work properly. The problem arises when I attempt to reject a promise like this:
login(credentials:Credentials):Promise<User> {
if (!valid) {
return Promise.reject<User>("Invalid password");
} else {
return Promise.resolve(new User("some user"));
}
}
This results in the following error message:
Error:(32, 22) TS2346: Supplied parameters do not match any signature of call target.