### File

`src/lib/directives/form-group-name.directive.ts`

### Deprecated

use the ParentControlContainerDirective

### Description

A full exertion of FormGroupName from @angular/forms. The only change is the ability to access the control container outside of the current component

### Extends

`FormGroupName`

### Metadata

Providers | `{ provide: ControlContainer, useExisting: forwardRef(() => FormGroupNameDirective), }`
Selector | `[rxapFormGroupName]`
Standalone | `true`
exportAs | `rxapFormGroup`

### Index

###### Inputs
rxapFormGroupName
###### Accessors
control

### Constructor

`constructor(parent: ControlContainer, validators: any[], asyncValidators: any[])`
Defined in src/lib/directives/form-group-name.directive.ts:43
Parameters :
Name | Type | Optional
parent | `ControlContainer` | No
validators | `any[]` | No
asyncValidators | `any[]` | No

### Inputs

rxapFormGroupName
Type : `string | number | null`
Defined in src/lib/directives/form-group-name.directive.ts:38

### Accessors

control
get `control()`
Defined in src/lib/directives/form-group-name.directive.ts:40

    import {
      Directive,
      forwardRef,
      Inject,
      Input,
      Optional,
      Self,
      SkipSelf,
    } from '@angular/core';
    import {
      ControlContainer,
      FormGroupName,
      NG_ASYNC_VALIDATORS,
      NG_VALIDATORS,
    } from '@angular/forms';
    import { RxapFormGroup } from '../form-group';

    /**
     * A full exertion of FormGroupName from @angular/forms. The only change is the
     * ability to access the control container outside of the current component
     *
     * @deprecated use the ParentControlContainerDirective
     */
    @Directive({
      selector: '[rxapFormGroupName]',
      providers: [
        {
          provide: ControlContainer,
          useExisting: forwardRef(() => FormGroupNameDirective),
        },
      ],
      exportAs: 'rxapFormGroup',
      standalone: true,
    })
    export class FormGroupNameDirective extends FormGroupName {

      @Input('rxapFormGroupName')
      public override name!: string | number | null;

      public override get control(): RxapFormGroup {
        // TODO : add type check
        return this.formDirective!.getFormGroup(this) as any;
      }

      constructor(
        @Optional() @SkipSelf() parent: ControlContainer,
        @Optional() @Self() @Inject(NG_VALIDATORS) validators: any[],
        @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: any[],
      ) {
        super(parent, validators, asyncValidators);
      }

    }

# results matching ""

# No results matching ""