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