aitboudad on main
build: update package-lock.json… build: remove bundlesize deps build: remove @swimlane/ngx-dat… (compare)
ngx-formly queries related to expression properties.
In our angular application we are using the ngx-formly version 5.10.23
I have few question related to that
minItems
JSONSchema property. You can play with the following stackbliz example: https://stackblitz.com/edit/angular-9znuyr?file=src%2Fapp%2Fapp.component.ts,src%2Fassets%2Fjson-schema%2Farrays.json,src%2Fapp%2Farray.type.ts. The editor is slow to load but by commenting the line 45 it is very fast. Many thank for your suggestions.
Hi, Can I populate the input field from API, I want to auto-populate the input field from the login API once the user comes to the form so his name and email should be pre-filled.
@aitboudad you suggested me to add defaultValue property
and this is what I did:
type: 'input',
key: 'customerId',
hooks: {
onInit(field) {
const control = field.formControl;
if (control.value === null) {
control.setValue(this.userName);
}
}
},
},
this is not working for me, my username is in userName, please suggest.
@sparshbha:matrix.org
@sparshbhardwaj:matrix.org this is not working for me, my username is in userName, please suggest.
use field.form.get('userName').setValue('test')
Hi everyone,
I have an issue validating an optional positive integer value with formly:
When I use
key: 'somekey',
type: 'input',
templateOptions: {
type: 'number',
min: 10,
max: 45,
label: 'some label',
}
This works if the field is required but not for optional fields.
If the field is optional the validator als accepts other charactes e.g. 'a', 'abc' etc.
I tried to combine type:number
with regex pattern but obviously the regex is ignored for number fields.
Is there any solution to validate optional positive integer values e.g.
type: 'number',
min: 10,
max: 45,
pattern: /^[0-9]+$/,