Suppose i have this promise in my component class.
testAsyncNumber = new Promise(
(res,rej)=>{
setTimeout(()=>{res([1,2,3,4,5])
},2000);
});
In view template i need to get data using async pipe. I tried following approach.
<div>
@for (number of (testAsyncNumber | async); track number) {
{{ number }}
} @empty {
Empty list of users
}
</div>
But this doesn't work. How to overcome with this issue?