Page MenuHomec4science

text-genese-selector-component.component.ts
No OneTemporary

File Metadata

Created
Sat, Aug 3, 07:16

text-genese-selector-component.component.ts

import {Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, ParamMap} from '@angular/router';
import {Subscription} from 'rxjs';
import {MatDialog} from '@angular/material/dialog';
import {TextgeneseSelectorDialogueComponentComponent} from './textgenese-selector-dialogue-component/textgenese-selector-dialogue-component.component';
import {CrossrefEditorDataServiceService} from '../crossref-editor-data-service.service';
@Component({
selector: 'app-text-genese-selector-component',
templateUrl: './text-genese-selector-component.component.html',
styleUrls: ['./text-genese-selector-component.component.scss']
})
export class TextGeneseSelectorComponentComponent implements OnInit, OnDestroy {
manuscripts: string[];
selectedManuscript: string;
queryParamSubscription: Subscription;
selectedTextGenesis: string;
constructor(private activatedRoute: ActivatedRoute,
private dataService: CrossrefEditorDataServiceService,
public dialog: MatDialog) {
}
ngOnInit() {
this.queryParamSubscription = this.activatedRoute.queryParamMap.subscribe((queryParams: ParamMap) => {
this.selectedManuscript = queryParams.get('manuscript');
this.selectedTextGenesis = queryParams.get('geneticOrder');
});
}
ngOnDestroy() {
this.queryParamSubscription.unsubscribe();
}
openRhizomeDialogue() {
const dialogRef = this.dialog.open(TextgeneseSelectorDialogueComponentComponent, {
width: '90vw',
height: '90vh',
data: this.selectedManuscript
});
dialogRef.afterClosed().subscribe(result => {
this.selectedTextGenesis = result.event;
console.log('The dialog was closed and we have chosen a textgenesis: ', result.event);
this.dataService.readInTextGenesis(result.event);
});
}
}

Event Timeline