Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"outputPath": "dist/client",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": [],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
Expand Down Expand Up @@ -63,10 +61,7 @@
"aot": false,
"optimization": false,
"extractLicenses": false,
"polyfills": [
"zone.js",
"zone.js/testing"
]
"polyfills": []
}
},
"defaultConfiguration": "production"
Expand Down
9 changes: 1 addition & 8 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"@angular/ssr": "^22.0.7",
"express": "^4.18.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.1"
"tslib": "^2.3.0"
},
"devDependencies": {
"@angular/build": "^22.0.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, ChangeDetectionStrategy, inject } from '@angular/core';
import { Router } from '@angular/router';
import { EmployeeFormComponent } from '../employee-form/employee-form.component';
import { EmployeeForm } from '../employee-form/employee-form';
import { Employee } from '../employee';
import { EmployeeService } from '../employee.service';
import { MatCardModule } from '@angular/material/card';

@Component({
selector: 'app-add-employee',
imports: [EmployeeFormComponent, MatCardModule],
imports: [EmployeeForm, MatCardModule],
template: `
<mat-card>
<mat-card-header>
Expand All @@ -23,7 +23,7 @@ import { MatCardModule } from '@angular/material/card';
changeDetection: ChangeDetectionStrategy.OnPush,
styles: ``
})
export class AddEmployeeComponent {
export class AddEmployee {
private readonly router = inject(Router);
private readonly employeeService = inject(EmployeeService);

Expand Down
3 changes: 2 additions & 1 deletion client/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZonelessChangeDetection } from '@angular/core';
import { provideRouter, withComponentInputBinding } from '@angular/router';

import { routes } from './app.routes';
Expand All @@ -9,6 +9,7 @@ import { provideAnimationsAsync } from '@angular/platform-browser/animations/asy
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideZonelessChangeDetection(),
provideRouter(routes, withComponentInputBinding()),
provideClientHydration(withNoIncrementalHydration()),
provideHttpClient(withFetch()),
Expand Down
12 changes: 6 additions & 6 deletions client/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { inject } from '@angular/core';
import { ResolveFn, Router, RedirectCommand, Routes } from '@angular/router';
import { catchError, of } from 'rxjs';
import { EmployeesListComponent } from './employees-list/employees-list.component';
import { AddEmployeeComponent } from './add-employee/add-employee.component';
import { EditEmployeeComponent } from './edit-employee/edit-employee.component';
import { EmployeesList } from './employees-list/employees-list';
import { AddEmployee } from './add-employee/add-employee';
import { EditEmployee } from './edit-employee/edit-employee';
import { Employee } from './employee';
import { EmployeeService } from './employee.service';

Expand All @@ -15,7 +15,7 @@ const employeeResolver: ResolveFn<Employee | RedirectCommand> = (route) => {
};

export const routes: Routes = [
{ path: '', component: EmployeesListComponent, title: 'Employees List' },
{ path: 'new', component: AddEmployeeComponent },
{ path: 'edit/:id', component: EditEmployeeComponent, resolve: { employee: employeeResolver } },
{ path: '', component: EmployeesList, title: 'Employees List' },
{ path: 'new', component: AddEmployee },
{ path: 'edit/:id', component: EditEmployee, resolve: { employee: employeeResolver } },
];
2 changes: 1 addition & 1 deletion client/src/app/app.component.ts → client/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ import { MatToolbarModule } from '@angular/material/toolbar';
</main>
`
})
export class AppComponent {
export class App {
title = 'client';
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, ChangeDetectionStrategy, input, inject } from '@angular/core';
import { EmployeeFormComponent } from '../employee-form/employee-form.component';
import { EmployeeForm } from '../employee-form/employee-form';
import { Router } from '@angular/router';
import { Employee } from '../employee';
import { EmployeeService } from '../employee.service';
import { MatCardModule } from '@angular/material/card';

@Component({
selector: 'app-edit-employee',
imports: [EmployeeFormComponent, MatCardModule],
imports: [EmployeeForm, MatCardModule],
template: `
<mat-card>
<mat-card-header>
Expand All @@ -24,7 +24,7 @@ import { MatCardModule } from '@angular/material/card';
changeDetection: ChangeDetectionStrategy.OnPush,
styles: ``
})
export class EditEmployeeComponent {
export class EditEmployee {
private readonly router = inject(Router);
private readonly employeeService = inject(EmployeeService);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import { Employee } from '../employee';
</form>
`
})
export class EmployeeFormComponent {
export class EmployeeForm {
private readonly formBuilder = inject(FormBuilder);

initialState = input<Employee>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import { MatCardModule } from '@angular/material/card';
</mat-card>
`
})
export class EmployeesListComponent {
export class EmployeesList {
private readonly employeeService = inject(EmployeeService);
private readonly employeesResource = this.employeeService.employeesResource;

Expand Down
5 changes: 2 additions & 3 deletions client/src/main.server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { provideZoneChangeDetection } from "@angular/core";
import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { App } from './app/app';
import { config } from './app/app.config.server';

const bootstrap = (context: BootstrapContext) => bootstrapApplication(AppComponent, {...config, providers: [provideZoneChangeDetection({ eventCoalescing: true }), ...config.providers]}, context);
const bootstrap = (context: BootstrapContext) => bootstrapApplication(App, config, context);

export default bootstrap;
5 changes: 2 additions & 3 deletions client/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { provideZoneChangeDetection } from "@angular/core";
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { App } from './app/app';

bootstrapApplication(AppComponent, {...appConfig, providers: [provideZoneChangeDetection({ eventCoalescing: true }), ...appConfig.providers]})
bootstrapApplication(App, appConfig)
.catch((err) => console.error(err));
Loading
Loading