Class

NgxCrudFormField

NgxCrudFormField()

Constructor

# new NgxCrudFormField()

Abstract class representing a CRUD form field for Angular applications

This class provides the base implementation for CRUD form fields in Angular, implementing both CrudFormField and ControlValueAccessor interfaces.

Implements:
  • FieldProperties
  • ControlValueAccessor

View Source lib/engine/NgxCrudFormField.ts, line 9

Members

# component

Reference to the component's element

ElementRef representing the component's native element

View Source lib/engine/NgxCrudFormField.ts, line 22

ElementRef

# component

Reference to the component's element

ElementRef representing the component's native element

View Source lib/engine/NgxCrudFormField.ts, line 196

# formGroup

Form group for the field

Angular FormGroup instance for the field

View Source lib/engine/NgxCrudFormField.ts, line 32

FormGroup | undefined

# formGroup

Form group for the field

Angular FormGroup instance for the field

View Source lib/engine/NgxCrudFormField.ts, line 208

# onChange

Change callback function

Function called when the field value changes

Properties:
Name Type Description
onChange function

onChange event handler

View Source lib/engine/NgxCrudFormField.ts, line 79

function

# onChange

Change callback function

Function called when the field value changes

Properties:
Name Type Description
onChange function

onChange event handler

View Source lib/engine/NgxCrudFormField.ts, line 228

# onTouch

Touch callback function

Function called when the field is touched

Properties:
Name Type Description
onTouch function

onTouch event handler

View Source lib/engine/NgxCrudFormField.ts, line 86

function

# onTouch

Touch callback function

Function called when the field is touched

Properties:
Name Type Description
onTouch function

onTouch event handler

View Source lib/engine/NgxCrudFormField.ts, line 235

# operation

Current CRUD operation

Represents the current CRUD operation being performed

View Source lib/engine/NgxCrudFormField.ts, line 27

CrudOperations

# operation

Current CRUD operation

Represents the current CRUD operation being performed

View Source lib/engine/NgxCrudFormField.ts, line 202

# parent

Parent HTML element

Reference to the parent HTML element of the field

View Source lib/engine/NgxCrudFormField.ts, line 65

HTMLElement

# protected parent

Parent HTML element

Reference to the parent HTML element of the field

View Source lib/engine/NgxCrudFormField.ts, line 215

# sf

String formatting function

Provides access to the sf function for error message formatting

Properties:
Name Type Description
sf function

String formatting function

View Source lib/engine/NgxCrudFormField.ts, line 72

# sf

String formatting function

Provides access to the sf function for error message formatting

Properties:
Name Type Description
sf function

String formatting function

View Source lib/engine/NgxCrudFormField.ts, line 221

Methods

# afterViewInit() → {HTMLElement}

After view initialization logic

Performs necessary setup after the view has been initialized

View Source lib/engine/NgxCrudFormField.ts, line 274

The parent element of the field

HTMLElement

# getErrors(parent) → {string|void}

Get field errors

Retrieves all errors associated with the field

Parameters:
Name Type Description
parent HTMLElement

View Source lib/engine/NgxCrudFormField.ts, line 289

An array of error objects

string | void

# onDestroy() → {void}

Cleanup on component destruction

Unregisters the field when the component is destroyed

View Source lib/engine/NgxCrudFormField.ts, line 281

void

# registerOnChange(fn) → {void}

Register change callback

Registers a function to be called when the field value changes

Parameters:
Name Type Description
fn function

The function to be called on change

View Source lib/engine/NgxCrudFormField.ts, line 251

void

# registerOnTouched(fn) → {void}

Register touch callback

Registers a function to be called when the field is touched

Parameters:
Name Type Description
fn function

The function to be called on touch

View Source lib/engine/NgxCrudFormField.ts, line 259

void

# setDisabledState(isDisabled) → {void}

Set disabled state

Sets the disabled state of the field

Parameters:
Name Type Description
isDisabled boolean

Whether the field should be disabled

View Source lib/engine/NgxCrudFormField.ts, line 267

void

# writeValue(obj) → {void}

Write value to the field

Sets the value of the field

Parameters:
Name Type Description
obj string

The value to be set

View Source lib/engine/NgxCrudFormField.ts, line 243

void