In the Angular CDK virtual Scrolling I'm using a list and adding items to the list from a button and it works. I'm having another button to remove item from the list but the UI is not refreshed with the removed content.
list: any[];
<cdk-virtual-scroll-viewport autoSize class="list-container lg" itemSize="5">
<ul *cdkVirtualFor="let item of list; let i = index;
let lastItem = last" class="list-group-item list-group-items list-group">
{{item}}
</ul>
</cdk-virtual-scroll-viewport>
Adding to list
const item = 4;
this.list = [...this.list, item];
How to remove the item from the list and refresh the view?
Note : I'm using non-observable data source.