Closed JaneDawson closed 7 years ago
Thank you! I appreciate that.
This should be fixed in version 4.1.5 ..let me know if you still experience any issues. Thanks!
Thank you for updating. I just tested it. Unfortunately it's still the same as before. Observing a single value doesn't work properly and sticks to the initial value.
Hi @JaneDawson, here's a working demo (source code) using angularfire2-offline version 4.1.5
When I was making the demo my package.json had "angularfire2-offline": "^4.1.5"
which resolved to version 4.2.0 (a version that was published unintentionally). By changing the package.json to "angularfire2-offline": "4.1.5"
the issue was fixed.
You can check which version your app is running by going to:
your-project/node_modules/angularfire2-offline/package.json
Let me know if this solves your issue. Thanks!
That fixed it for me, as well. Works just fine now. Thank you, @adriancarriger. I appreciate it!
Awesome, glad it's working now! 👍
Unfortunately, I have to reopen this issue. Everything works fine, except if the value of the subscribed attribute is 0.
If in the following example the account balance object ..users/'userId'/balance'
is 0 in the database, then bal.$value
becomes undefined
. This shouldn't be, since 0 is a valid value for the balance.
getBalanceStream(userId){
this.db.object('/users/'+userId+'/balance').subscribe( bal=> {
this.balance= bal.$value;
}
}
Anything new here?
Hi @JaneDawson, thanks for reopening! I'll be looking into this!
Thank you. I appreciate that. Works well now!
Awesome, glad it's working! 👍
When I subscribe to a single value in my Firebase DB, the observable doesn't trigger when the value changes.
In the following example the "balance" node is of type "Number".
When the user's balance changes in the database, the arrow function is not triggered.
this.balance
doesn't get updated.When I use regular AngularFire2 it works as expected.