firebase-element
firebase-element copied to clipboard
What is the best-practice to use the query object we get from collections.add ?
I have a collection component that i use to list my products. When i add a new product to the collection i want to notify the user that the product has been added.
In order to do this i was thinking to use the component document and collection together binding on the query object.
For instance when i add the product i get a query object as a result that contains the path of the product just added. I was thinking to set this in the document component in order to retrieve the product just added but it is not working. The query property in the document component is readonly so is not possible to populate it from the outside.
In order to overcome this issue i am getting the path array from the query object and i am populating the location in the document component with it. I am not sure if this is the right way to proceed and i would like to have your opinion.