Load data from Firebase using AngularJS immediately
<p>I am trying to make a comments section on my website. I have properly linked all my files and getting data from Firebase is working. But, the comments only load <em>after</em> I either click on something or enter text in the "Add comment" field; it does not show the comments instantly when the page loads. Does anyone know why?</p>

<p>Relevant code: (placed at the top of my controller)</p>

<pre class="lang-js prettyprint-override"><code>$scope.comments = {};
database.ref('comments').on('value', function(items) {
  $scope.comments = items.val();
});
$scope.comment = function() {
  database.ref('comments').push($scope.newComment);
  $scope.newComment = "";
};
</code></pre>