chore(ui): clear reader settings prefer-inject bucket
Convert reader settings and shared setup/custom-font components to field injection so these UI surfaces follow the project inject() convention without changing behavior. Validation: just ui lint
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, EventEmitter, Inject, Input, OnInit, Output, Renderer2} from '@angular/core';
|
||||
import {Component, EventEmitter, inject, Input, OnInit, Output, Renderer2} from '@angular/core';
|
||||
import {DecimalPipe, DOCUMENT} from '@angular/common';
|
||||
import {TranslocoDirective} from '@jsverse/transloco';
|
||||
import {ReaderStateService} from '../state/reader-state.service';
|
||||
@@ -39,13 +39,10 @@ export class ReaderSettingsDialogComponent implements OnInit {
|
||||
{name: 'orange', value: '#FFD580', label: 'Orange'}
|
||||
];
|
||||
|
||||
constructor(
|
||||
private bookService: BookService,
|
||||
private customFontService: EpubCustomFontService,
|
||||
private renderer: Renderer2,
|
||||
@Inject(DOCUMENT) private document: Document
|
||||
) {
|
||||
}
|
||||
private bookService = inject(BookService);
|
||||
private customFontService = inject(EpubCustomFontService);
|
||||
private renderer = inject(Renderer2);
|
||||
private document = inject(DOCUMENT);
|
||||
|
||||
ngOnInit() {
|
||||
this.customFontService.injectCustomFontsStylesheet(this.renderer, this.document);
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||
import {Component, EventEmitter, inject, Input, Output} from '@angular/core';
|
||||
import {DecimalPipe} from '@angular/common';
|
||||
import {TranslocoDirective} from '@jsverse/transloco';
|
||||
import {ReaderStateService} from '../../state/reader-state.service';
|
||||
@@ -19,7 +19,7 @@ export class ReaderQuickSettingsComponent {
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
@Output() openFullSettings = new EventEmitter<void>();
|
||||
|
||||
constructor(private bookService: BookService) {}
|
||||
private bookService = inject(BookService);
|
||||
|
||||
get state() {
|
||||
return this.stateService.state();
|
||||
|
||||
@@ -25,6 +25,8 @@ export interface ReaderState {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ReaderStateService {
|
||||
private bookService = inject(BookService);
|
||||
private userService = inject(UserService);
|
||||
private epubCustomFontService = inject(EpubCustomFontService);
|
||||
|
||||
private readonly BASE_FONTS = [
|
||||
@@ -62,7 +64,7 @@ export class ReaderStateService {
|
||||
private readonly _fonts = signal<{ name: string; value: string | null }[]>(this.BASE_FONTS);
|
||||
readonly fonts = this._fonts.asReadonly();
|
||||
|
||||
constructor(private bookService: BookService, private userService: UserService) {
|
||||
constructor() {
|
||||
this.loadCustomFontsIntoList();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user