Skip to content
Snippets Groups Projects
compound-element.directive.ts 1020 B
Newer Older
  • Learn to ignore specific revisions
  • jojohoch's avatar
    jojohoch committed
      Directive, EventEmitter, Input, Output, QueryList
    
    } from '@angular/core';
    import { FormGroup } from '@angular/forms';
    
    import { ElementComponent } from './element-component.directive';
    
    rhenck's avatar
    rhenck committed
    import { CompoundChildOverlayComponent } from '../components/compound-child-overlay.component';
    
    import { LikertRadioButtonGroupComponent } from '../components/ui-elements/likert-radio-button-group.component';
    
    import { InputElement } from '../interfaces/elements';
    
    export abstract class CompoundElementComponent extends ElementComponent implements AfterViewInit {
    
      @Output() childrenAdded = new EventEmitter<ElementComponent[]>();
    
    jojohoch's avatar
    jojohoch committed
      @Input() parentForm!: FormGroup;
    
      compoundChildren!: QueryList<CompoundChildOverlayComponent | LikertRadioButtonGroupComponent>;
    
        this.childrenAdded.emit(this.getFormElementChildrenComponents());
    
      }
    
      abstract getFormElementModelChildren(): InputElement[];
    
      abstract getFormElementChildrenComponents(): ElementComponent[];