- Refactor to remove BookMetadataBI
- Use inject everywhere instead of constructor injection
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {Component, inject, Input} from '@angular/core';
|
||||
import {LogNotification} from '../../../shared/websocket/model/log-notification.model';
|
||||
import {EventService} from '../../../shared/websocket/event.service';
|
||||
|
||||
@@ -15,11 +15,11 @@ export class LiveNotificationBoxComponent {
|
||||
|
||||
latestEvent: LogNotification = {message: 'No recent notifications...'};
|
||||
|
||||
constructor(private eventService: EventService) {
|
||||
private eventService = inject(EventService);
|
||||
|
||||
constructor() {
|
||||
this.eventService.latestEvent$.subscribe(event => {
|
||||
this.latestEvent = event;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {AppSettingsService} from '../../service/app-settings.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {AppSettings} from '../../model/app-settings.model';
|
||||
@@ -57,13 +57,11 @@ export class SettingsComponent implements OnInit {
|
||||
fontSize: number = 100;
|
||||
selectedFont: any;
|
||||
|
||||
appSettings$!: Observable<AppSettings | null>;
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
appSettings$: Observable<AppSettings | null> = this.appSettingsService.appSettings$;
|
||||
|
||||
constructor(private appSettingsService: AppSettingsService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.appSettings$ = this.appSettingsService.appSettings$;
|
||||
this.appSettings$.subscribe(settings => {
|
||||
if (settings) {
|
||||
this.populateSettings(settings);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {inject, Injectable} from '@angular/core';
|
||||
import {MessageService} from 'primeng/api';
|
||||
|
||||
@Injectable({
|
||||
@@ -6,7 +6,7 @@ import {MessageService} from 'primeng/api';
|
||||
})
|
||||
export class ToastService {
|
||||
|
||||
constructor(private messageService: MessageService) {}
|
||||
private messageService = inject(MessageService);
|
||||
|
||||
showSuccess(summary: string, detail: string) {
|
||||
this.messageService.add({ severity: 'success', summary, detail });
|
||||
|
||||
Reference in New Issue
Block a user