I am trying to figure out how to pass a value from a subscribe function to a variable so that I can manipulate it later on. For example:
getNumber: number;
I need to be able to access and use the variable getNumber in the same .ts file.
someMethodTwo() {
this.someMethod().subscribe(data =>
Swal.fire({
position: 'top-end',
icon: 'success',
title: 'The variable is '+ getNumber ,
showConfirmButton: false,
timer: 1500
})
}
someMethodOne() {
this.someMethod().subscribe(data =>
this.getNumber= data);
}