### File

`src/lib/directives/array/form-array-item-restore-button.directive.ts`

### Extends

`FormArrayItemButton`

### Implements

`AfterViewInit` `OnDestroy`

### Metadata

Selector | `button[rxapFormArrayItemRestoreButton]`
Standalone | `true`

### Index

###### Properties
Protected deletedControl Protected formArray Protected formGroup type
###### Methods
onClick updateDisplayStyle
###### HostBindings
disabled type
###### HostListeners
click

### HostBindings

disabled
Type : `boolean`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:47`

type
Type : `string`
Default value : `'button'`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:31`

### HostListeners

click
Defined in src/lib/directives/array/form-array-item-restore-button.directive.ts:17

### Methods

onClick
`onClick()`
Decorators : `@HostListener('click')`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:17`
Returns : `void`

updateDisplayStyle
`updateDisplayStyle()`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:21`
Returns : `void`

### Properties

Protected deletedControl
Type : `RxapFormControl<boolean>`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:34`

Protected formArray
Type : `RxapFormArray`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:33`

Protected formGroup
Type : `RxapFormGroup<literal type>`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:32`

type
Type : `string`
Default value : `'button'`
Decorators : `@HostBinding('type')`
Inherited from `FormArrayItemButton`
Defined in `FormArrayItemButton:31`

    import {
      AfterViewInit,
      Directive,
      HostListener,
      OnDestroy,
    } from '@angular/core';
    import { FormArrayItemButton } from './form-array-item-button';

    // TODO : move to rxap packages
    @Directive({
      selector: 'button[rxapFormArrayItemRestoreButton]',
      standalone: true,
    })
    export class FormArrayItemRestoreButtonDirective extends FormArrayItemButton implements AfterViewInit, OnDestroy {

      @HostListener('click')
      override onClick() {
        this.formGroup.controls.deleted.setValue(false);
      }

      override updateDisplayStyle() {
        if (this.isDeleted) {
          this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
        } else {
          this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');
        }
      }

    }

# results matching ""

# No results matching ""