-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
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
destructive update 'set' doesn't exist #1051
Comments
Thanks for the reply.
The reason I asked about the set method is I noticed it was used in one of
the examples not just for objects but for lists as well in the github doc
here (https://github.com/angular/angularfire2/blob/master/docs/3-retrieving-data-as-lists.md)
![image](https://user-images.githubusercontent.com/12807659/27764411-a18abe3a-5e4d-11e7-99fb-0596d07ec700.png)
Granted, set is not listed in the API summary table. But the example above
is clearly using 'set' and I think I saw a pull request that made 'set'
available for lists too. If this is incorrect, would you mind updating the
docs please?
Thanks!
…On Fri, Jun 30, 2017 at 9:47 PM, James Brinkerhoff ***@***.*** > wrote:
list doesn't have a method called set. You add to it with push.
const list = this.afDb.list(url);
list.push(value);
or you can use an object to get the set method
const myObject = this.afDb.object(url);
myObject.set(key, value);
btw, you might want to use update instead of set because set replaces all
the data on the path with the value you pass.
Go study the docs some more.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1051 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMNt67UCoCc-R2NKN1gcqFe_qH10SBRwks5sJc9jgaJpZM4OLM2n>
.
|
@fancyydk This should either be removed from the docs or a PR is welcome to add the feature. The original PR was never finished, so it's up for grabs if you'd like it. |
@fancyydk Not a problem in the latest version 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version info
Angular: 4.1.3
Firebase: 4.1.3
AngularFire: 4.0.0-rc.1
Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic3/Cordova
How to reproduce these conditions
Failing test unit, Plunkr, or JSFiddle demonstrating the problem
Steps to set up and reproduce
private afDb: AngularFireDatabase;
...
const list = this.afDb.list(url);
list.set(key, value);
Debug output
There's an error that says
Property 'set' does not exist on type 'FirebaseListObservable<any[]>'.
** Screenshots **
The text was updated successfully, but these errors were encountered: