25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|||
|
|
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||
|
|
import type { DocumentScreen } from './document-screens';
|
||
|
|
|
||
|
|
/** Formulario del documento: `nuevo` (vacío) o `:docEntry` (ver / editar). Se construye en el paso 9. */
|
||
|
|
@Component({
|
||
|
|
selector: 'sbo-document-form-page',
|
||
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||
|
|
imports: [RouterLink],
|
||
|
|
template: `
|
||
|
|
<h1>{{ title }} — {{ docEntry ? 'documento ' + docEntry : 'nuevo' }}</h1>
|
||
|
|
<p>El formulario aún no está disponible. <a routerLink="..">Volver a la lista</a></p>
|
||
|
|
`,
|
||
|
|
styles: `
|
||
|
|
h1 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
|
||
|
|
p { margin: 0; color: var(--quiet); }
|
||
|
|
a { color: var(--focus); }
|
||
|
|
`,
|
||
|
|
})
|
||
|
|
export class DocumentFormPage {
|
||
|
|
private readonly route = inject(ActivatedRoute);
|
||
|
|
protected readonly title = this.route.snapshot.data['title'] as string;
|
||
|
|
protected readonly screen = this.route.snapshot.data['screen'] as DocumentScreen;
|
||
|
|
protected readonly docEntry = this.route.snapshot.paramMap.get('docEntry');
|
||
|
|
}
|