Permalink
Browse files

Step 2.7: Add stubs for chats objects

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent e113247 commit 473ba02578ce934cad09384e8808ab3f48f4d1de
Showing with 54 additions and 0 deletions.
  1. +54 −0 src/pages/chats/chats.ts
View
@@ -1,10 +1,64 @@
import { Component } from '@angular/core';
import { Observable } from 'rxjs';
import * as moment from 'moment';
@Component({
templateUrl: 'chats.html'
})
export class ChatsPage {
chats: Observable<any[]>;
constructor() {
this.chats = this.findChats();
}
private findChats(): Observable<any[]> {
return Observable.of([
{
_id: '0',
title: 'Ethan Gonzalez',
picture: 'https://randomuser.me/api/portraits/thumb/men/1.jpg',
lastMessage: {
content: 'You on your way?',
createdAt: moment().subtract(1, 'hours').toDate()
}
},
{
_id: '1',
title: 'Bryan Wallace',
picture: 'https://randomuser.me/api/portraits/thumb/lego/1.jpg',
lastMessage: {
content: 'Hey, it\'s me',
createdAt: moment().subtract(2, 'hours').toDate()
}
},
{
_id: '2',
title: 'Avery Stewart',
picture: 'https://randomuser.me/api/portraits/thumb/women/1.jpg',
lastMessage: {
content: 'I should buy a boat',
createdAt: moment().subtract(1, 'days').toDate()
}
},
{
_id: '3',
title: 'Katie Peterson',
picture: 'https://randomuser.me/api/portraits/thumb/women/2.jpg',
lastMessage: {
content: 'Look at my mukluks!',
createdAt: moment().subtract(4, 'days').toDate()
}
},
{
_id: '4',
title: 'Ray Edwards',
picture: 'https://randomuser.me/api/portraits/thumb/men/2.jpg',
lastMessage: {
content: 'This is wicked good ice cream.',
createdAt: moment().subtract(2, 'weeks').toDate()
}
}
]);
}
}

0 comments on commit 473ba02

Please sign in to comment.