I'm struggling to receive the promise from the backend after making a get request. Can anyone help me figure out what I might be doing wrong?
makeLoginCall(_username: string, _password: string) {
let promise = new Promise((resolve, reject) => {
this.http.get('xxx').subscribe(data => {
});
});
return promise;
}
login() {
this.userService.makeLoginCall(this.formLogin.value.username, this.formLogin.value.password)
.then(response => {
console.log(response);
},
(response) => {
if (response.status < 500) {
console.warn('Login failed!');
} else {
console.error('Internal Server Error');
}
});
}