I am retriving some data from firebase via observable in valueChanges
method.
this.authService.getUser().subscribe(
user => {
this.studentDetailsService.readStudentDatabase( user.uid ).subscribe( temp => {
this.student = temp as StudentDetails ;
});
}
);
but i cant use this.student
objects out side the Observable like this
this.authService.getUser().subscribe(
user => {
this.studentDetailsService.readStudentDatabase( user.uid ).subscribe( temp => {
this.student = temp as StudentDetails ;
});
}
);
this.name = this.student.firstName;
when im doing this console shows this.name
is undefined.
how to solve this ?? how can i use those retrived values outside the observable ?