I am trying to retrieve the value of totalDeals and then implement a check to see if it is greater than 0, but I keep encountering the following error :
Operator '>' cannot be applied to types 'Subscription' and 'number'.ts(2365)
https://i.sstatic.net/bxOH4.png
code
ngOnInit(): void { this.leaseId = this.transaction.leaseId; this.getAllDealsCount(); } getAllDealsCount() { let totalDeals = zip(this.getCount('ForApproval'),this.getCount('Draft')) .subscribe(res => this.totalDeals = res[0].data + res[1].data) } private getCount(item: any) { let status = item; return this.dealService.getCount( this.accountId, this.transaction.id, status ) }