How do I prevent particular AngularFire-bound attributes from saving back to Firebase?

42 views Asked by At

I'm looking for a way to have ephemeral data stored inside an AngularFire three-way-bound object (such as state) but I can't find a good way to prevent it from persisting that data back to Firebase - the only way I've found so far is to prefix it with $ which I suspect might be wrong.

I've read the following:

Angular.js does not report variables prefixed with $ to any $watch listeners. a simple workaround here is to use a variable prefixed with _, which will not be saved to the server, but will trigger $watch.

But it doesn't work for me, i.e. the following code:

shelf._editingName = false

saves _editingName: false back to Firebase (shelf is part of a larger array which is all three-way-bound).

What am I doing wrong? Is the quote above still correct? Is there anything really wrong with using a $ prefix?

0

There are 0 answers