2017-07-17 15:11:34 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2017-07-18 16:34:12 +00:00
|
|
|
import { Mail } from './mail.model';
|
|
|
|
import { MailService } from './mail.service';
|
2017-07-08 16:12:52 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector : 'fuse-mail',
|
|
|
|
templateUrl: './mail.component.html',
|
|
|
|
styleUrls : ['./mail.component.scss']
|
|
|
|
})
|
|
|
|
export class MailComponent implements OnInit
|
|
|
|
{
|
2017-07-18 16:34:12 +00:00
|
|
|
selectedMail: Mail;
|
2017-07-08 16:12:52 +00:00
|
|
|
|
2017-07-17 15:11:34 +00:00
|
|
|
constructor(
|
2017-07-18 16:34:12 +00:00
|
|
|
private mailService: MailService
|
2017-07-17 15:11:34 +00:00
|
|
|
)
|
2017-07-08 16:12:52 +00:00
|
|
|
{
|
2017-07-18 16:34:12 +00:00
|
|
|
|
2017-07-08 16:12:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit()
|
|
|
|
{
|
2017-07-18 16:34:12 +00:00
|
|
|
this.selectedMail = this.mailService.selectedMail;
|
2017-07-17 15:11:34 +00:00
|
|
|
|
2017-07-18 16:34:12 +00:00
|
|
|
this.mailService.onSelectedMailUpdated
|
|
|
|
.subscribe(selectedMail => {
|
|
|
|
this.selectedMail = selectedMail;
|
|
|
|
});
|
2017-07-16 18:41:01 +00:00
|
|
|
}
|
2017-07-08 16:12:52 +00:00
|
|
|
}
|