d9474a85c5387aa927c172cc54e7a336057c4aef
[evergreen/equinox.git] /
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 }