I have a function
async submit(form) {
const selectedPackage = await this.packages.toPromise().then(result => {
result.forEach(element => {
if (element._id === form.package) {
return element;
}
});
});
const selectedCompany = await this.companies.toPromise().then(result => {
result.forEach(company => {
if (company._id === form.company) {
return company;
}
});
});
console.log(selectedPackage);
console.log(selectedCompany);
it returns :
Subscriber {closed: false, _parent: null, _parents: null, _subscriptions: Array(1), syncErrorValue: null, …}closed: truedestination: SafeSubscriber {closed: true, _parent: null, _parents: null, _subscriptions: null, syncErrorValue: null, …}isStopped: truesyncErrorThrowable: falsesyncErrorThrown: falsesyncErrorValue: null_parent: null_parents: null_subscriptions: null__proto__: Subscription addCredit-c.ts:76
Subscriber {closed: false, _parent: null, _parents: null, _subscriptions: Array(1), syncErrorValue: null, …}
Now, what I want is to get the selected package as JSON
format from packages list, but it returns Subscriber
The same thing goes for the company.
Any idea how to solve this problem?