Answer the question
In order to leave comments, you need to log in
How can I get different collections from firebase into an array, in an angular controller?
Hello.
I want to get data from two collections of the form into an array:
And display it on the page in the form:
<div ng-repeat="post in vm.allPosts">
<h3>
{{ post.postCaption }}
</h3>
<p>
{{ post.postText }}
</p>
<span>Автор: {{ post.ownerName }}
<div ng-repeat="comment in post.comments">
<h4>
{{ comment.commentText }}
</h4>
<p>
{{ comment.ownerName }}
</p>
</div>
</div>
$q.all( [ getPosts(), getComments() ] ).then(
function (results) {
doSomethingOnThem(results[0], results[1]);
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question