We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not sure if it's just me or if this is a bug or not :D
addToCart(cartArticle: CartArticle) { this.cart.articles.push(cartArticle); this.refreshExpireDate(); this._storage.store('cart', this.cart); } removeFromCart(index: number) { this.cart.articles.splice(index, 1); this.refreshExpireDate(); this._storage.store('cart', this.cart); }
In both functions I see that the refreshExpireDate does trigger in my service as it is updated in localstorage...
refreshExpireDate
but the subscription I have does not trigger on remove.. only add?
this.storage.observe('cart').pipe( startWith(this.storage.retrieve('cart')) ).subscribe(cart => { console.log('checkoutpage', cart); this.cartSubject.next(cart); });
The text was updated successfully, but these errors were encountered:
Oh.. It must be something with the dirty checking in angular where the object does not change but only the underlaying array..
Sorry, something went wrong.
Spoke to soon.. There is something else going on here..
ngOnInit() { this.storage.observe('cart').pipe( startWith(this.storage.retrieve('cart')) ).subscribe(cart => { console.log('summary', cart); this.cartSubject.next(cart); }); }
This summary only triggers on the first remove.. but all adds?
No branches or pull requests
Not sure if it's just me or if this is a bug or not :D
In both functions I see that the
refreshExpireDate
does trigger in my service as it is updated in localstorage...but the subscription I have does not trigger on remove.. only add?
The text was updated successfully, but these errors were encountered: