fuse-angular/src/app/main/apps/mail/mail.component.ts

31 lines
659 B
TypeScript
Raw Normal View History

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';
@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-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-18 16:34:12 +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;
});
}
}