Sorry, but I’m having trouble following you.
First off, can I assume that there is only one “me” here? We’re not talking a massive multiplayer situation where if I buy the last apple in the store, then everybody else worldwide has to have “apples” come out of their possible virtual shelf?
So, if that’s the case, then when I buy an item, what exactly does “disappear” mean here? Because in the code you originally posted, nothing really “disappears”, it just gets shifted around in the list.
Where would “somewhere else” be here? Also, what does “check” mean? Is this the “check” of “checkbox” or the “check” as a synonym for “investigate”?
What does this mean? Did you try the code I posted? I didn’t see any flickering or disappearing and reappearing. There is one virtual list that is simply a concatenation of an ngFor loop across two distinct backing lists.
No, you don’t. You may need [ngModel] and (ionChange) for those dual purposes, but remember that “banana-in-a-box” is shorthand. What [(ngModel)] means is effectively
[ngModel]="foo" (ngModelChange)="foo = $event". It’s both an input and an output binding. You do not need the banana binding on ngModel because you are doing equivalent work in (ionChange).
The main point I want to emphasize here is that fundamentally, you have a shopping cart (even more true if you’re running a grocery store). It strikes me as much more logical to group items into “stuff in my cart” and “stuff sitting on shelves” buckets, instead of going through every aisle in the store and putting a sticker on the product saying “this is in Raul’s cart” or “nope, not in Raul’s cart”.
Now, if you do in fact have a massive multiplayer situation, then there are much more thorny concurrency issues in play, but they exist far from the realm of UI that we’re talking about here, and when it comes to UI, I think that carrying the data as two separate buckets will be easier to both manage and present than carrying it as one. One ancillary benefit would be that you no longer need the checked property on products at all.