Cancel/Reset Changes to a $firebaseObject
d1b1 opened this issue · comments
Stephan L. Smith commented
Not sure the best venue for this request. Not a bug. Is there a way to 'reset' or chancel changes made to a model? Or is there a way to force the $firebaseObject to fetch() data and discard any cached changes?
I have been able to extend the $firebaseObject with a $cancel that uses the ref to fetch the data again and update the model. But not certain this is the best way.
Alex Sales commented
Rather than extend the $firebaseObject, wouldn't it be easier to just re-define/re-declare your model if wanted to reset it?
// this initially fetches the data
var model = $firebaseObject(ref);
// .. but say later in your code you setup a cancel button for your user
// this resets it and fetches the data again
model = $firebaseObject(ref);
David East commented
Hi @d1b1! We have a required issue template, so I'm going to close this issue. I think @alexsales answer will work for you.