Files
ng-blog/frontend/src/app/routes/post/post.component.ts
2025-04-10 16:17:58 +02:00

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));
}
}