how can I access or get the value of this.dealType outside this.trasactionService.transactionEvent$. suscription ? . I wanted to access the data and value ofthis.dealType outside , maybe someone can help.
it has value inside the this.trasactionService.transactionEvent$.subscrib but I want to access it outside , I tried logging it using console logs its empty
Thank you, appreciated.
#code
export class DealsApprovalComponent implements OnInit {
dealType: string;
totalDealsForApproval = 0;
constructor(
private dealService: DealService,
private notificationService: NotificationService,
private trasactionService: TransactionService,
private route: Router,
private dealTransactionService: DealTransactionService
)
{
}
ngOnInit(): void {
this.trasactionService.transactionEvent$.subscribe((data) => {
if(data) {
switch (data['operation']) {
case 'deal/deal-type':
this.dealType = data["dealType"];
break;
}
}
},
(error) => {}
);
console.log("this.dealType" , this.dealType)
}