NgDocJsonControlComponent
The playground control of array inputs that have no list control, such as Item[] or [string, number]: a text area that holds the value as JSON.
Text that parses sets the value; while the text is not JSON, the field is marked as invalid and the input keeps its last valid value. An empty field is undefined, and the value that the playground writes is shown as JSON again, so the text and the value always match. It edits any value that JSON can hold, so it can also be registered for an object type.
- Decorators
@Component - Selectors
ng-doc-json-control - Generic types
T- Extends
DIControl<T | undefined, T | undefined>- Implements
NgDocTypeControl <T | undefined>
@Component ({ … })
export class NgDocJsonControlComponent <T = unknown>
extends DIControl<T | undefined>
implements NgDocTypeControl <T | undefined> { … }Members
Constructor1 | |||||||||||||||||
() | — | ||||||||||||||||
Signature | |||||||||||||||||
Properties15 | |||||||||||||||||
change: (value: T | null) => void | — | ||||||||||||||||
changeDetectorRef: | — | ||||||||||||||||
config?: DIControlConfig<TModel, TChildModel> | undefined | — | ||||||||||||||||
disabledValue: | — | ||||||||||||||||
elementRef: | — | ||||||||||||||||
errorId: string | ID of the message that describes invalid text. | ||||||||||||||||
incomingUpdate?: ((value: T | null) => void) | undefined | — | ||||||||||||||||
invalid: | Whether the text is not JSON. | ||||||||||||||||
model: | — | ||||||||||||||||
ngControl: | — | ||||||||||||||||
renderer: | — | ||||||||||||||||
rows: | The rows of the field: its lines, from 2 to 10. | ||||||||||||||||
text: | The text of the field. | ||||||||||||||||
texts: | — | ||||||||||||||||
touch: () => void | Function that should be used to make control touched. | ||||||||||||||||
Accessors3 | |||||||||||||||||
get disabled: boolean | Returns true if the control is disabled. | ||||||||||||||||
set disabled: boolean | — | ||||||||||||||||
get hasValue: boolean | Returns true if the control is not empty. | ||||||||||||||||
Methods5 | |||||||||||||||||
(…): void | Sets the value from the text of the field, when it is JSON. | ||||||||||||||||
Signature Parameters
Returns void | |||||||||||||||||
(): void | — | ||||||||||||||||
Signature Returns voidOverloads
| |||||||||||||||||
(…): void | Method is called by the forms API. | ||||||||||||||||
Signature Parameters
Returns voidOverloads
| |||||||||||||||||
(…): void | Updates the model of the current control. This is the main method that should be used to update the model. | ||||||||||||||||
Signature Parameters
Returns voidOverloads
| |||||||||||||||||
(…): void | Method is called by the forms API to write to the view when programmatic changes from model to view are requested. | ||||||||||||||||
Signature Parameters
Returns void | |||||||||||||||||