0

I have one page where I need to load multiple nodes from the Firebase Real-Time Database. The structure is as follows:

/overview/$date/list
/overview/$date/alerts
/overview/$date/other

What is more efficient when using AngularJS 1.x:

  • load overview/$date once
  • or creating multiple functions and loading per node:
    • load /overview/$date/list
    • load /overview/$date/alerts
    • load /overview/$date/other

1 Answer 1

1

Assuming that $date only contains those same three children, and you want all the children all the time, you will probably not measure much of a difference between the two. The single query may be a tad faster. But if you have other children under it that you don't want to read, the single query might be slower, as it's loading more data than you need.

2
  • Lets assume that we need to load all the data (with their children). Then there will be no difference? How about adding it to the scope in AngularJS: scope.data = result or is it better scope.list = result['list'] etc?
    – WJA
    Commented Jan 15, 2019 at 19:03
  • I didn't say "no difference" - I said not much of a difference. It's an optimization that might not be measurable. I don't think scope has anything to do with it. If you have a different question about scope, please ask it as a separate question. Commented Jan 15, 2019 at 19:05

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.