Initial commit

This commit is contained in:
2018-03-02 02:59:55 -05:00
parent 30518e56d4
commit 33cf657c70
34 changed files with 541 additions and 124 deletions

View File

@@ -0,0 +1,39 @@
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { ProfileService } from '../../services/profiles';
import { ProfilePage } from '../profile/profile';
import { ChatPage } from '../chat/chat';
@Component({
selector: 'page-messages',
templateUrl: 'messages.html',
providers: [ ProfileService ]
})
export class MessagesPage {
profiles: any;
constructor(public navCtrl: NavController, public profileService: ProfileService) {
profileService.load().then((data) => {
this.profiles = data;
});
}
getLatestMessage(messages) {
var latest = Math.max.apply(Math, messages.map(function(o){ return o.order; }));
return messages[latest].text != '' ? messages[latest].text : '<em>Picture</em>';
}
interviewTapped(event, profile) {
this.navCtrl.push(ChatPage, {
profile: profile
});
}
profilePictureTapped(event, profile) {
this.navCtrl.push(ProfilePage, {
profile: profile
});
}
}