import { Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { DemoService } from '../../../demo/services/demo.service' @Component({ selector: 'app-messages-read', template: `
{{message.datetime | date: 'medium' }}
{{ message.from.name }} {{ message.from.surname }} {{ message.from.email }}
`, styles: [ ` .message { white-space: pre-line; } `, ], }) export class MessagesReadComponent implements OnInit { public buttons = [ { type: 'button', icon: 'fe fe-arrow-left', action: 'BACK', }, { type: 'button', icon: 'fe fe-trash', action: 'DELETE', }, ] public message constructor(private route: ActivatedRoute, private demoService: DemoService) {} ngOnInit() { const messageId = this.route.snapshot.params['message'] this.message = this.demoService.messages[messageId] } }