ngfor prints messy

0

I have problems with a chat I'm doing with angle 5 and firebase, I show the messages with the ngFor send them to me randomly.

    <div class="alert alert-{{item.color}} mt-2" role="alert" *ngFor="let item of items">
    {{item.user}} dice: {{item.name}}

link of the chat: link

    
asked by Mario 19.04.2018 в 03:03
source

1 answer

1

The order depends on how you have "filled in" the arrangement, which depends completely on the order in the specified entry in your data source by some element such as some date or key value, as you comment that is Firebase, for RealTimeDb the reference it's here: link (How to sort and filter data)

or for FireStore here: ( link )

    
answered by 30.04.2018 / 18:33
source