]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/share/marc-edit/simplified-editor/simplified-editor-subfield.directive.ts
LP1849212: Improvements to the Simplified Marc Editor
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / share / marc-edit / simplified-editor / simplified-editor-subfield.directive.ts
1 import {Directive, Input, Host, OnInit} from '@angular/core';
2 import {MarcSimplifiedEditorFieldDirective} from './simplified-editor-field.directive';
3
4 /**
5  * A subfield that a user can edit, which will later be
6  * compiled into MARC
7  */
8
9 @Directive({
10   selector: 'eg-marc-simplified-editor-subfield',
11 })
12 export class MarcSimplifiedEditorSubfieldDirective implements OnInit {
13
14   @Input() code: string;
15   @Input() defaultValue: string;
16
17   constructor(@Host() private field: MarcSimplifiedEditorFieldDirective) {}
18
19   ngOnInit() {
20     this.field.addSubfield(this.code, this.defaultValue);
21   }
22
23 }