serve frontend from go
This commit is contained in:
20
web/src/app/routes/dashboard/dashboard.component.ts
Normal file
20
web/src/app/routes/dashboard/dashboard.component.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Component, effect, inject } from '@angular/core';
|
||||
import { PostEditorComponent } from '../../components/post-editor/post-editor.component';
|
||||
import { NgFor } from '@angular/common';
|
||||
import { PostsService } from '../../shared/services/posts.service';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-admin',
|
||||
imports: [NgFor, RouterLink],
|
||||
standalone: true,
|
||||
templateUrl: './dashboard.component.html',
|
||||
})
|
||||
export class DashboardComponent {
|
||||
private postsService = inject(PostsService);
|
||||
posts = this.postsService.getPosts();
|
||||
|
||||
delete(id: number) {
|
||||
this.postsService.deletePost(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user