20 lines
556 B
TypeScript
20 lines
556 B
TypeScript
import { Component, inject, Input } from '@angular/core';
|
|
import { PostsService } from '../../shared/services/posts.service';
|
|
import { JsonPipe, NgIf } from '@angular/common';
|
|
import { MarkdownComponent } from '../../components/markdown/markdown.component';
|
|
|
|
@Component({
|
|
selector: 'app-post',
|
|
imports: [MarkdownComponent],
|
|
standalone: true,
|
|
templateUrl: './post.component.html',
|
|
})
|
|
export class PostComponent {
|
|
private posts = inject(PostsService);
|
|
@Input() id!: string;
|
|
|
|
get post() {
|
|
return this.posts.getPost(parseInt(this.id));
|
|
}
|
|
}
|