Files
adastra_app/src/app/app.component.ts
T
julien be5f5775ef chore(deps): upgrade Angular 19 → 20
- ng update @angular/core@20 @angular/cli@20 @angular/material@20 @angular-eslint@20 @angular/google-maps@20
- Remove ng-chartist (abandoned, incompatible with Angular 20): replace <x-chartist> with <app-bars-chart> in dropzones-bar and jumps-by-month
- Migrate all constructor injection to inject() function (ng generate @angular/core:inject, 67 files)
- TypeScript 5.5 → 5.9.3
- DOCUMENT import moved from @angular/common to @angular/core (automatic migration)
- tsconfig moduleResolution updated to "bundler"
2026-04-26 06:40:13 +02:00

47 lines
1.3 KiB
TypeScript

import { Component, OnInit, AfterContentInit, inject } from '@angular/core';
import { MAT_DATE_LOCALE, MAT_DATE_FORMATS, provideNativeDateAdapter } from '@angular/material/core';
import { Title } from '@angular/platform-browser';
import { FullComponent } from '@components/shared/layout';
import { UserService } from '@services';
export const MY_FORMATS = {
parse: {
dateInput: 'DD/MM/YYYY',
},
display: {
dateInput: 'DD/MM/YYYY',
monthYearLabel: 'MMM YYYY',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM-YYYY',
},
};
@Component({
selector: 'app-root',
imports: [FullComponent],
providers: [
{ provide: MAT_DATE_LOCALE, useValue: 'fr-FR' },
{ provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
provideNativeDateAdapter(MY_FORMATS),
],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
export class AppComponent implements OnInit, AfterContentInit {
private userService = inject(UserService);
private titleService = inject(Title);
public title = 'Ad Astra';
public appClass = 'grayscale';
ngOnInit() {
this.userService.populate();
this.titleService.setTitle(this.title);
}
ngAfterContentInit() {
this.appClass = 'colored';
}
}