File

projects/aoc-client/components/aoc-form/aoc-form-controller.ts

Index

Properties
Methods
Accessors

Properties

_formGroup
Type : FormGroup
Readonly deleting$
Default value : this.#deleting$.asObservable()

Deleting status observable. True when form is deleting, false otherwise.

Readonly saving$
Default value : this.#saving$.asObservable()

Saving status observable. True when form is saving, false otherwise.

Methods

addAfterDeleteAction
addAfterDeleteAction(action: AocFormControllerEventAction)

Adds an action after saving the model. The action can be async and return a string error which will be shown.

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
addAfterSaveAction
addAfterSaveAction(action: AocFormControllerEventAction)

Adds an action after saving the model. The action can be async and return a string error which will be shown.

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
addBeforeDeleteAction
addBeforeDeleteAction(action: AocFormControllerEventAction)

Adds an action before saving the model. The action can be async and return a string error which will cancel the save action

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
addBeforeSaveAction
addBeforeSaveAction(action: AocFormControllerEventAction)

Adds an action before saving the model. The action can be async and return a string error which will cancel the save action

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
addDeleteErrorAction
addDeleteErrorAction(action: AocFormControllerEventAction)

Adds an action when a save error occurs

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
addSaveErrorAction
addSaveErrorAction(action: AocFormControllerEventAction)

Adds an action when a save error occurs

Parameters :
Name Type Optional
action AocFormControllerEventAction<T> No
Returns : void
autopatch
autopatch()
Returns : boolean
Public complete
complete()

Send a complete signal to all internal observables.

Returns : void
Static custom
custom(config: literal type)
Parameters :
Name Type Optional
config literal type No
Returns : Provider
Async delete
delete()

Fires the delete method in the aco-form

Returns : any
Async getActionResults
getActionResults(event: AocFormControllerEvent<any>)

Method to handle actions errors

Parameters :
Name Type Optional Description
event AocFormControllerEvent<any> No

the fired event

Returns : Promise<string[]>

an array of errors as strings

getFormGroup
getFormGroup()
Returns : FormGroup<{ [K in keyof T]: AbstractControl<T[K]>; }>
isPatched
isPatched()
Returns : boolean
Async model
model()
Returns : Promise<T>
Async patched
patched()
Returns : Promise<T>
Async patchModel
patchModel()
Returns : any
registerPatchAsyncHandler
registerPatchAsyncHandler(handler: Promise)
Parameters :
Name Type Optional
handler Promise<void> No
Returns : void
Async save
save()

Fires the save method in the aco-form and returns the saved model when complete.

Returns : Promise<T>
setDeleteFn
setDeleteFn(deleteFn: () => void)

Sets the delete function. Used by aoc-form, binds its delete function to this method

Parameters :
Name Type Optional
deleteFn function No
Returns : void
setFormGroup
setFormGroup(formGroup: FormGroup)
Parameters :
Name Type Optional
formGroup FormGroup No
Returns : void
setModel
setModel(model: T)
Parameters :
Name Type Optional
model T No
Returns : void
setSaveFn
setSaveFn(saveFn: () => void)

Sets the save function. Used by aoc-form, binds its save function to this method

Parameters :
Name Type Optional
saveFn function No
Returns : void

Accessors

saving
getsaving()

True when form is saving the model, false otherwise.

setsaving(_saving)

Sets the saving status

Parameters :
Name Optional
_saving No
Returns : void
deleting
getdeleting()

True when form is deleting the model, false otherwise.

setdeleting(_deleting)

Sets the deleting status

Parameters :
Name Optional
_deleting No
Returns : void

results matching ""

    No results matching ""