Page MenuHomec4science

textgenese-selector-dialogue-component.component.ts
No OneTemporary

File Metadata

Created
Mon, Sep 9, 08:17

textgenese-selector-dialogue-component.component.ts

import {Component, forwardRef, Inject, OnChanges} from '@angular/core';
import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {NG_VALUE_ACCESSOR} from '@angular/forms';
import {ActivatedRoute, ParamMap} from '@angular/router';
import {Subscription} from 'rxjs';
import {TlnQueryService} from '../../../tln-edition/services';
@Component({
selector: 'app-textgenese-selector-dialogue-component',
templateUrl: './textgenese-selector-dialogue-component.component.html',
styleUrls: ['./textgenese-selector-dialogue-component.component.scss'],
providers: [TlnQueryService,
{
provide: NG_VALUE_ACCESSOR, multi: true,
useExisting: forwardRef(() => TextgeneseSelectorDialogueComponentComponent),
}
]
})
export class TextgeneseSelectorDialogueComponentComponent implements OnChanges {
selectedTextGenesis: string;
queryParamSubscription: Subscription;
maxWidth: number;
constructor(private queryService: TlnQueryService, private dialogRef: MatDialogRef<TextgeneseSelectorDialogueComponentComponent>,
@Inject(MAT_DIALOG_DATA) public selectedManuscript: string, public activatedRoute: ActivatedRoute) {
this.maxWidth = window.innerWidth/1.5;
this.selectedTextGenesis = 'http://rdfh.ch/projects/0068#_Mp_XIV_TextGenesis0'; // TODO: Read Output
}
ngOnChanges() {
this.queryParamSubscription = this.activatedRoute.queryParamMap.subscribe((queryParams: ParamMap) => {
this.selectedManuscript = queryParams.get('manuscript');
// this.selectedTextGenesis = queryParams.get('geneticOrder'); // Todo: ReadOUt
});
}
apply() {
this.dialogRef.close({event: this.selectedTextGenesis});
}
}

Event Timeline