0
I have a service that returns me a user object with a user id:
My object:
export class Usuario{
email: string;
password: string;
}
In my component I urge my object to get the return of service:
usuario: Usuario = new Usuario();
And then my service does the request by returning the object with the id I need:
this.authService.fazerLogin(email,password)
.subscribe(
(data) => {
this.usuario = data;
)}
If I do a console.log(user), I get the id I need, but I would like to save the return in a string variable instead of an object so that in the future I save this value in a localstorage to make requests...
How I extract this value for a variable?