i've got a configuration-screen with an Ionic ion-list, where the user can add items to the list and also the current entries of the list are being shown. I want the user to be able to add new items via a button. the new items should not immediatelly be saved to firebase - the user has to press a save-button to do this. currently my code looks like this
<ion-list *ngIf="regimeList">
<ion-list-header color="secondary">Items
<button class="my-select" ion-button outline item-end (click)="addItem()">+</button>
</ion-list-header>
<ion-item *ngFor="let item of itemList">
{{item.name}}
</ion-item>
</ion-list>
the data for itemList is from a observable with a little mapping/formating:
this.$ref = this.database.list('/items/' + uid);
this.$ref.subscribe(snapshot => { this.map2itemList(snapshot) });
when the user clicks the ion-button, he gets a popup where he can enter a new item. on pressing "ok", the new entry should be show in the list, but not saved to firebase. So i cant use
this.$ref.push(myNewItem);
because of the observable the data will directly be commited and my view updated. what is a good strategy to seperate these two actions? thank you in advance.