I’m loading some credit cards using the function loadAllCard , but i also need with to load the customer data , to see if the card that i’m loading its equal to the customer default card , so inside ma cardForm i’m calling the loadCustomer function to compare.
comparison goes well , but when i assign the value to bool , it doesn’t work , when i return the value too.
can anyone helps me figure out , how can i do
In your case, you’re not actually returning anything inside the observable function; you’re returning values inside the promise.
I would try a slightly different approach with this. Instead just return an empty Observable, and fill it in the promise handler as soon as you get your data:
Please i have a similar problem. all i want to do is to return the value of the array that comes from the subscription in getData function. for some reason, return keyword dosent work
I haven’t used angular stuff with Fuse before, so there could be things I’m missing, but there are a couple things that I suspect could be wrong here:
Are you trying to data-bind to getData()? If so, then you should make that a property (get getData()).
Also, if this.authService.getSales() is asynchronous, then you can’t be certain this.user has been updated at the point where you return it. I would split up the call to authService from the getData property here.
Of none of this works, i would need more information to be of any help.
so i know this.authService.getSales() is asynchronous but how do i return its result after this.authService.getSales() is done fetching the data (which is supposed to be an array). i need the result to be returned to the getData method so i can use it in the component.