Compare commits

...
This repository has been archived on 2025-02-19. You can view files and clone it, but cannot push or open issues or pull requests.

3 commits

Author SHA1 Message Date
Phan Huy Tran
a01b2bf140 Remove title 2025-02-05 10:51:39 +01:00
Phan Huy Tran
8a6c4e1603 Clean up 2025-02-05 10:51:13 +01:00
Phan Huy Tran
dbab1bdf08 Convert package json to bun, create bun.lock 2025-02-05 10:44:48 +01:00
9 changed files with 2113 additions and 13441 deletions

2107
frontend/bun.lock Normal file

File diff suppressed because it is too large Load diff

13383
frontend/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,11 +2,11 @@
"name": "lf10-starter2024", "name": "lf10-starter2024",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "bunx @angular/cli",
"start": "ng serve --proxy-config src/proxy.conf.json", "start": "bunx @angular/cli serve --proxy-config src/proxy.conf.json",
"build": "ng build", "build": "bunx @angular/cli build",
"watch": "ng build --watch --configuration development", "watch": "bunx @angular/cli build --watch --configuration development",
"test": "ng test" "test": "bunx @angular/cli test"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {

View file

@ -1,6 +0,0 @@
export class Hello {
constructor(public id?: number,
public message?: string,
) {
}
}

View file

@ -1,7 +1,3 @@
<h1>LF12 Starter</h1>
<a href="/hello">hello</a>
<router-outlet></router-outlet> <router-outlet></router-outlet>

View file

@ -1,7 +1,4 @@
import { Routes } from '@angular/router'; import {Routes} from '@angular/router';
import {HelloListComponent} from "./hello-list/hello-list.component";
import {authGuard} from "./auth.guard";
export const routes: Routes = [ export const routes: Routes = [
{ path: 'hello', component: HelloListComponent , canActivate: [authGuard] }
]; ];

View file

@ -1,8 +0,0 @@
<h3>List of Hellos</h3>
<ul>
@for(e of employees$ | async; track e.id) {
<li>
{{e.id }}, {{e.message}}
</li>
}
</ul>

View file

@ -1,31 +0,0 @@
import { Component } from '@angular/core';
import {Observable, of} from "rxjs";
import {Hello} from "../Hello";
import {HttpClient, HttpClientModule, HttpHeaders, provideHttpClient} from "@angular/common/http";
import {AsyncPipe} from "@angular/common";
import {KeycloakService} from "keycloak-angular";
@Component({
selector: 'app-hello-list',
standalone: true,
imports: [
AsyncPipe
],
providers: [KeycloakService],
templateUrl: './hello-list.component.html',
styleUrl: './hello-list.component.css'
})
export class HelloListComponent {
employees$: Observable<Hello[]>;
constructor(private http: HttpClient) {
this.employees$ = of([]);
this.fetchData();
}
fetchData() {
this.employees$ = this.http.get<Hello[]>('/backend/hellos');
}
}