src/lib/directives/array/form-array-item-restore-button.directive.ts
AfterViewInit
OnDestroy
Selector | button[rxapFormArrayItemRestoreButton] |
Standalone | true |
Properties |
|
Methods |
HostBindings |
HostListeners |
disabled |
Type : boolean
|
Inherited from
FormArrayItemButton
|
Defined in
FormArrayItemButton:47
|
type |
Type : string
|
Default value : 'button'
|
Inherited from
FormArrayItemButton
|
Defined in
FormArrayItemButton:31
|
click |
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
|
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');
}
}
}