@if (chat) {
@if (chat.contact.avatar) { } @if (!chat.contact.avatar) {
{{ chat.contact.name.charAt(0) }}
}
{{ chat.contact.name }}
@for ( message of chat.messages; track trackByFn(i, message); let i = $index; let first = $first; let last = $last ) { @if ( first || (chat.messages[i - 1].createdAt | date: 'd') !== (message.createdAt | date: 'd') ) {
{{ message.createdAt | date: 'longDate' }}
}
@if ( last || chat.messages[i + 1].isMine !== message.isMine ) {
}
@if ( first || last || chat.messages[i + 1].isMine !== message.isMine || chat.messages[i + 1].createdAt !== message.createdAt ) {
{{ message.createdAt | date: 'HH:mm' }}
}
}
} @else {
Select a conversation or start a new chat
}