Refactor calendar settings dialog to use dynamic settings from service (#30)
* Refactor calendar settings dialog to use dynamic settings from service * Update src/app/components/dialog/calendar-settings-dialog/calendar-settings-dialog.html Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add type definition for calendar settings array (#35) * Initial plan * Add type definition for calendar settings array Co-authored-by: THoguet <61246905+THoguet@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: THoguet <61246905+THoguet@users.noreply.github.com> * use inject --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
3 files changed
+35
-26
No files matched your search
@@ -1,4 +1,10 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { Injectable, signal, WritableSignal } from '@angular/core';
|
||||
|
||||
interface CalendarSetting {
|
||||
signal: WritableSignal<boolean>;
|
||||
id: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -6,4 +12,17 @@ import { Injectable, signal } from '@angular/core';
|
||||
export class CalendarSettingsService {
|
||||
readonly showWeekNumbers = signal(false);
|
||||
readonly samediMalin = signal(true);
|
||||
|
||||
readonly settings: readonly CalendarSetting[] = [
|
||||
{
|
||||
signal: this.showWeekNumbers,
|
||||
id: 'showWeekNumbers',
|
||||
description: 'Afficher les numéros de semaine',
|
||||
},
|
||||
{
|
||||
signal: this.samediMalin,
|
||||
id: 'samediMalin',
|
||||
description: 'Activer le Samedi Malin',
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in new issue
Block a user