import { Component , OnInit } from '@angular/core' ; import { FormControl , FormGroup , Validators } from '@angular/forms' ; import { DocapiBuilderTypeStepBaseComponent } from '../docapi-builder-type-step-base/docapi-builder-type-step-base.component' ; import { TypeService } from '../../../../framework/services/type.service' ; import { CmdbType } from '../../../../framework/models/cmdb-type' ; @ Component ( { selector : 'cmdb-docapi-settings-builder-type-step-object' , templateUrl : './docapi-builder-type-step-object.component.html' , styleUrls : [ './docapi-builder-type-step-object.component.scss' ] } ) export class DocapiBuilderTypeStepObjectComponent extends DocapiBuilderTypeStepBaseComponent implements OnInit { public objectTypeList : Array < CmdbType > = [ ] ; constructor ( private typeService ) { super ( ) ; this . typeParamForm = new FormGroup ( { type : new FormControl ( '' , Validators . required ) } ) ; } public ngOnInit ( ) { this . typeParamForm . valueChanges . subscribe ( ( ) => { this . formValid = this . typeParamForm . valid ; this . formValidationEmitter . emit ( this . formValid ) ; } ) ; this . typeService . getTypeList ( ) . subscribe ( ( value ) => this . objectTypeList = value ) ; } }