Click multiple objects at once

How can I make multiple object clicks at the same time using angularfire2?

A simple click on an array of objects does not set keys for each object.

this.af.database.list( '/symbols/').push( { typ :"symbol1", .... } ); this.af.database.list( '/symbols/').push( { typ :"symbol2", .... } ); 
+5
source share
1 answer

Using the regular Firebase JavaScript SDK, you can do the following:

 var updates = {}; updates['/symbols/'+ref.push().key] = { typ :"symbol1", .... }; updates['/symbols/'+ref.push().key] = { typ :"symbol2", .... }; ref.update(updates); 

Since AngularFire2 is built on top of the regular Firebase JavaScript SDK, they interact well. Therefore, you can simply use the Firebase JavaScript SDK for this operation.

+12
source

Source: https://habr.com/ru/post/1266129/


All Articles