I\'m getting this reponse when making an http request in service.
Here\'s the Login component
export class LoginComponent {
credentials: Credentials;
try like this :
service.ts
login(credentials): Observable {
return this.http.post("http://localhost:3000/api/Users/login", {
username: credentials.username,
password: credentials.password
}).map(data => data.json())
}
component.ts
onLogin(credentials) {
this.userService.login(credentials)
.subscribe(data => {
console.log('data', data);
}, (error) => {
console.log('error', error);
})
}