show first entry
This commit is contained in:
19
frontend/src/app/routes/post/post.component.ts
Normal file
19
frontend/src/app/routes/post/post.component.ts
Normal file
@ -0,0 +1,19 @@
|
||||
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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user