serve frontend from go

This commit is contained in:
u80864958
2025-05-05 10:00:50 +02:00
parent a06444c4df
commit 73a62b63ae
88 changed files with 76 additions and 36 deletions

View File

@ -0,0 +1,39 @@
import {
Component,
effect,
EventEmitter,
Input,
Output,
signal,
} from '@angular/core';
import { MarkdownComponent } from '../markdown/markdown.component';
import { FormsModule } from '@angular/forms';
import { Post } from '../../shared/interfaces/post';
@Component({
selector: 'app-post-editor',
imports: [MarkdownComponent, FormsModule],
standalone: true,
templateUrl: './post-editor.component.html',
})
export class PostEditorComponent {
@Input('post') data = signal<Post>({
id: 0,
title: '',
tldr: '',
content: '',
});
@Output('postChange') dataChange = new EventEmitter<Post>();
set title(val: string) {
this.data.update((d) => ({ ...d, title: val }));
}
set tldr(val: string) {
this.data.update((d) => ({ ...d, tldr: val }));
}
set content(val: string) {
this.data.update((d) => ({ ...d, content: val }));
}
}