desktop: fix build errors — FormsModule for settings, nativeWindow alias, move provideHttpClient to appConfig
This commit is contained in:
parent
b792b36eae
commit
f4b7e2542e
@ -1,11 +1,13 @@
|
||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideRouter(routes)
|
||||
provideRouter(routes),
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
]
|
||||
};
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { DesktopComponent } from './components/desktop/desktop.component';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
standalone: true,
|
||||
imports: [FormsModule, RouterOutlet, DesktopComponent],
|
||||
providers: [provideHttpClient()],
|
||||
imports: [DesktopComponent],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss',
|
||||
})
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
interface SettingSection {
|
||||
id: string;
|
||||
@ -10,7 +11,7 @@ interface SettingSection {
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
imports: [CommonModule, FormsModule],
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrl: './settings.component.scss',
|
||||
})
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
[style.display]="windowState.isMinimized ? 'none' : 'flex'"
|
||||
[style.left.px]="windowState.isMaximized ? 0 : windowState.x"
|
||||
[style.top.px]="windowState.isMaximized ? 0 : windowState.y"
|
||||
[style.width.px]="windowState.isMaximized ? window.innerWidth : windowState.width"
|
||||
[style.height.px]="windowState.isMaximized ? (window.innerHeight - 48) : windowState.height"
|
||||
[style.width.px]="windowState.isMaximized ? nativeWindow.innerWidth : windowState.width"
|
||||
[style.height.px]="windowState.isMaximized ? (nativeWindow.innerHeight - 48) : windowState.height"
|
||||
[style.z-index]="windowState.zIndex"
|
||||
>
|
||||
<!-- Title bar -->
|
||||
|
||||
@ -55,6 +55,9 @@ export class WindowComponent implements AfterViewInit, OnDestroy {
|
||||
return this.elementRef.nativeElement;
|
||||
}
|
||||
|
||||
/** Expose native window for template bindings (avoids conflict with component name). */
|
||||
readonly nativeWindow = globalThis.window;
|
||||
|
||||
constructor(private elementRef: ElementRef) {}
|
||||
|
||||
// ── Drag ───────────────────────────────────────────────────────────────
|
||||
|
||||
Loading…
Reference in New Issue
Block a user