import { Component , Input } from '@angular/core' ; import { AuthProvider } from '../../../../auth/models/providers' ; import { FormArray , FormControl , FormGroup } from '@angular/forms' ; @ Component ( { selector : 'cmdb-local-authentication-provider-form' , templateUrl : './local-authentication-provider-form.component.html' , styleUrls : [ './local-authentication-provider-form.component.scss' ] } ) export class LocalAuthenticationProviderFormComponent { public form : FormGroup ; public parent : FormArray ; public provider : AuthProvider ; @ Input ( 'parent' ) public set Parent ( form ) { this . parent = form ; this . parent . insert ( 0 , new FormGroup ( { class_name : new FormControl ( 'LocalAuthenticationProvider' ) , config : this . form } ) ) ; } @ Input ( 'provider' ) public set Provider ( provider ) { this . provider = provider ; this . form . patchValue ( provider . config ) ; } constructor ( ) { this . form = new FormGroup ( { active : new FormControl ( ) } ) ; this . form . get ( 'active' ) . disable ( { onlySelf : true } ) ; } }