{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/angularfire/issues/595","labels_url":"https://api.github.com/repos/firebase/angularfire/issues/595/labels{/name}","comments_url":"https://api.github.com/repos/firebase/angularfire/issues/595/comments","events_url":"https://api.github.com/repos/firebase/angularfire/issues/595/events","html_url":"https://github.com/firebase/angularfire/issues/595","id":65237639,"number":595,"title":"Am I doing things right - loading data from multiple locations","user":{"login":"JerryBels","id":4408419,"avatar_url":"https://avatars.githubusercontent.com/u/4408419?v=3","gravatar_id":"","url":"https://api.github.com/users/JerryBels","html_url":"https://github.com/JerryBels","followers_url":"https://api.github.com/users/JerryBels/followers","following_url":"https://api.github.com/users/JerryBels/following{/other_user}","gists_url":"https://api.github.com/users/JerryBels/gists{/gist_id}","starred_url":"https://api.github.com/users/JerryBels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JerryBels/subscriptions","organizations_url":"https://api.github.com/users/JerryBels/orgs","repos_url":"https://api.github.com/users/JerryBels/repos","events_url":"https://api.github.com/users/JerryBels/events{/privacy}","received_events_url":"https://api.github.com/users/JerryBels/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-30T15:26:15Z","updated_at":"2015-03-31T16:21:08Z","closed_at":"2015-03-30T17:07:38Z","body":"Hello !\r\n\r\nSo I have the need to display an image, which is linked to many other data sources. Basically the image has an uploader, an album, a list of tagged users, and a list of messages.\r\n\r\nFor example to get the tagged users, I'm forced to make a call for each one of them, since I'm storing only their IDs in the media object and I need their names, genders etc...\r\n\r\nA first query would go get the media data, and when the promise is resolved ($loaded), other promises must be fullfilled before returning to the controller the data for the view to display.\r\n\r\n\t$firebaseObject(media).$loaded.then(func(mediaData) {\r\n\t\t$firebaseObject(uploader)...\r\n\t\t$firebaseObject(album)...\r\n\t\t\r\n\t\tforeach(tagged_users)\r\n\t\t\t$firebaseObject(this_user)...\r\n\t\t\r\n\t\tforeach(messages)\r\n\t\t\t$firebaseObject(this_message)...\r\n\t\t\r\n\t\t// when all data has been fetched successfully send it over to the controller\r\n\t\t$q.all(promises).then(function(){\r\n\t\t\tdeferred.resolve(allData);\r\n\t\t});\r\n\t})\r\n\r\nIt works perfectly well but : \r\n\r\n- Is this a good way to do things with Firebase and AngularFire ?\r\n- Performance speaking, all these $firebaseObject instances could be an issue ? Knowing I simplified it, there is a lot more data to fetch actually... Before stable release there was the $off method that could have proved usefull. Maybe should I just use Once from the regular Firebase, skipping AngularFire for the data that doesn't needs to be keep in sync ?\r\n- How will this behave when references will grow to have millions of records ?\r\n\r\nThanks a lot !"},"comment":{"url":"https://api.github.com/repos/firebase/angularfire/issues/comments/88154629","html_url":"https://github.com/firebase/angularfire/issues/595#issuecomment-88154629","issue_url":"https://api.github.com/repos/firebase/angularfire/issues/595","id":88154629,"user":{"login":"katowulf","id":959972,"avatar_url":"https://avatars.githubusercontent.com/u/959972?v=3","gravatar_id":"","url":"https://api.github.com/users/katowulf","html_url":"https://github.com/katowulf","followers_url":"https://api.github.com/users/katowulf/followers","following_url":"https://api.github.com/users/katowulf/following{/other_user}","gists_url":"https://api.github.com/users/katowulf/gists{/gist_id}","starred_url":"https://api.github.com/users/katowulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katowulf/subscriptions","organizations_url":"https://api.github.com/users/katowulf/orgs","repos_url":"https://api.github.com/users/katowulf/repos","events_url":"https://api.github.com/users/katowulf/events{/privacy}","received_events_url":"https://api.github.com/users/katowulf/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T16:21:08Z","updated_at":"2015-03-31T16:21:08Z","body":"Also, other options are certainly available here, like utilizing `ng-show=\"record.username\"` or something along these lines, which would prevent displaying the data until the content is fully loaded. But it doesn't seem like that should be necessary since everything is loading in milliseconds."}}