Files
DTFluxTitrage-Client/src/app/app.component.ts

45 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-07-13 05:02:55 +02:00
// src/app/app.component.ts
2025-07-12 19:54:10 +02:00
import { Component } from '@angular/core';
2025-07-13 05:02:55 +02:00
import { CommonModule } from '@angular/common';
import { TitleSheetsFormComponent } from './view/components/title-sheets-form/title-sheets-form.component';
import { TitleSheet, createEmptyTitleSheet } from './models/title-sheet.model';
import { Router, RouterModule, RouterOutlet } from '@angular/router';
2025-07-12 19:54:10 +02:00
@Component({
selector: 'app-root',
2025-07-13 05:02:55 +02:00
standalone: true,
imports: [
CommonModule,
RouterOutlet,
TitleSheetsFormComponent // ← Import direct du composant
],
2025-07-12 19:54:10 +02:00
templateUrl: './app.component.html',
2025-07-13 05:02:55 +02:00
styleUrls: ['./app.component.scss']
2025-07-12 19:54:10 +02:00
})
export class AppComponent {
2025-07-13 05:02:55 +02:00
title = 'test-title-sheets';
testTitleSheet: TitleSheet;
debugInfo: any = {};
constructor() {
// Créer un titleSheet de test
this.testTitleSheet = createEmptyTitleSheet();
this.debugInfo.testTitleSheet = this.testTitleSheet;
}
onTitleSheetSaved(titleSheet: TitleSheet): void {
console.log('Title Sheet saved:', titleSheet);
this.debugInfo.lastSaved = titleSheet;
this.debugInfo.savedAt = new Date();
// Créer un nouveau titleSheet pour la suite
this.testTitleSheet = createEmptyTitleSheet();
}
onFormReset(): void {
console.log('Form reset');
this.debugInfo.lastAction = 'Form reset';
this.debugInfo.resetAt = new Date();
}
2025-07-12 19:54:10 +02:00
}