Page MenuHomec4science

crossref-editor-component.component.ts
No OneTemporary

File Metadata

Created
Fri, May 10, 10:46

crossref-editor-component.component.ts

import {Component, OnChanges} from '@angular/core';
import {CrossrefEditorDataServiceService, TextGenesis, TextVersion} from './crossref-editor-data-service.service';
import {ActivatedRoute} from '@angular/router';
import {TlnQueryService} from '../tln-edition/tln-query.service';
@Component({
selector: 'app-crossref-editor-component',
templateUrl: './crossref-editor-component.component.html',
styleUrls: ['./crossref-editor-component.component.scss']
})
export class CrossrefEditorComponentComponent implements OnChanges {
textGenesis: TextGenesis;
addNewTextGenesis = false; // whether a new Textgenesis will be generated
editExistingTextGenesis = false; // whether an existing Textgenesis should be edited
constructor(private dataService: CrossrefEditorDataServiceService,
private activatedRoute: ActivatedRoute) {
}
ngOnChanges() {
}
initNewTextgenesis() {
this.addNewTextGenesis = true;
this.textGenesis = new TextGenesis('TextGenesis', this.activatedRoute.snapshot.queryParamMap.get('manuscript'));
this.textGenesis.checkOut(true);
// also adding new text version
let version = new TextVersion('TextVersion', this.textGenesis.iri);
this.textGenesis.addTextVersion(version, 0);
// emit to service
this.dataService.updateAll(this.textGenesis);
}
}

Event Timeline