Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:32
    aitboudad closed #3402
  • 19:32
    aitboudad unlabeled #3402
  • 19:32
    aitboudad labeled #3402
  • 19:31
    aitboudad labeled #3409
  • 19:31
    aitboudad unlabeled #3409
  • 19:26
    aitboudad commented #3413
  • 19:17
    aitboudad commented #3404
  • 19:17

    aitboudad on main

    build: update package-lock.json… build: remove bundlesize deps build: remove @swimlane/ngx-dat… (compare)

  • 19:17
    aitboudad closed #3405
  • 19:17
    aitboudad closed #3404
  • Aug 12 09:39
    ivanshilo commented #3356
  • Aug 11 12:32
    afLennart labeled #3413
  • Aug 11 12:32
    afLennart opened #3413
  • Aug 09 10:49
    eng-dibo labeled #3412
  • Aug 09 10:49
    eng-dibo opened #3412
  • Aug 09 08:14
    Garfield-fr labeled #3411
  • Aug 09 08:14
    Garfield-fr opened #3411
  • Aug 09 07:08
    ng-commander commented #1818
  • Aug 09 07:07
    ng-commander commented #1818
  • Aug 09 07:04
    ng-commander commented #1818
Nitin
@thenm

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

  1. Are formly fields rendered synchronously? If it is happening asynchronously can we make this synchronously by setting some property
  2. When is the expression properties are triggered after field are rendered and thier default values are set?
  3. Can one field depend on the multiple field values and how can we create expression property for the same.
PG03
@PG03
Is there a way to take the formly json and transform the Form to a pdf or image format?
1 reply
Johnny Mariéthoz
@jma
Hello do you know if the minProperties JSONSchema property is supported by ngx-formly? Thanks in advance?
Abdellatif Ait boudad
@aitboudad
@jma Hi, not supported yet!
Johnny Mariéthoz
@jma
@aitboudad thanks for the reply. I will use a custom validator.
Amera Tag Eldin
@Amira-tageldin
Hello all ,i need to do a calculated field based on other field and json is dynamic .. is that should be done in expression properties?
1 reply
mohithtintu
@mohithtintu:matrix.org
[m]
Hi, i have created a form using ngx formly and also i have created few simple component with simple ngmodel and i am printing the vale , now i want to render or display my component data in the component where i used ngx formly . can i succeed using this by adding the component name or selector in json
1 reply
Johnny Mariéthoz
@jma
Hello I want to have a JSONSchema with an array with one element at the startup that support the children default value. Here is the stackblitz example: https://stackblitz.com/edit/angular-zt5dys?file=src%2Fassets%2Fjson-schema%2Farrays.json. Here I want to have the value "name" in the input field. Do I have to create an issue or I did something wrong?
Abdellatif Ait boudad
@aitboudad
@jma create an issue, its a bug
Johnny Mariéthoz
@jma
Ok thanks
Abdellatif Ait boudad
@aitboudad
@jma seems not an issue but rather wrong usage, I left an answer in https://github.com/ngx-formly/ngx-formly/issues/3245#issuecomment-1081761641
Johnny Mariéthoz
@jma
@aitboudad It seems that you mixed two issues.
scryer-John
@scryer-John
Hi, Is there a way to make formly fields invalidate and remove model values if they do not comply to the fields validations. Currently if a string value is passed to a number field that is required, via the model, the validation is not triggered. The field will show as valid with no visible value in the input. If the form is submitted the string is sent from the form controls value as if it is correct.
2 replies
Dominic Watson
@intellix

having issues with expressionProperties.hide: Observable<boolean> only taking 1x emit.

expressionProperties: {
  hide: source$,
},

does that have a take(1) internally or something?

I can see that it is finalizing on a single emit
Dominic Watson
@intellix
I think because the field is being removed so it completes, but I'm not sure how to solve this
Dominic Watson
@intellix
I can swap it for a hideExpression since I'm using a BehaviorSubject, but I guess it's not as optimal because it'll check more often than needed
Abdellatif Ait boudad
@aitboudad
@intellix it should work, I may need a reproduction!
Samiullah Khan
@technbuzz
I have a structure like
transaction: { transactionnumber: '', involvedParty: [ '1', { role: 1 } ] }
1 reply
Now I am using Flex layout with flex group but it nested the fields in HTML, how can keep this nested order in model and fields but have a non nested html markup?
image.png
Nick Beckley
@NickBeckley23
Hello. I'm wondering on the status of the formly 6 core upgrade. We are trying to upgrade Node to version 16 which requires npm 8. npm 8 is not compatible with formly 5.10. Is formly 5.12.1 compatible with npm 8? Or will we need to wait for formly 6 still? Thank you.
2 replies
Johnny Mariéthoz
@jma
Hello, is it possible to know when the editor has been completely loaded/initialized? Many thanks.
4 replies
lnkhrs
@lnkhrs
@aitboudad Hello! Wanted to follow up with you about the Formly officially adopting Angular 13. My team is wondering wether we should upgrade our app to this version or keep the older version. Thanks & much appreciated.
Abdellatif Ait boudad
@aitboudad
@lnkhrs Angular 13 support is available in v6.0.0-next.9 version, you may expect a beta release this week then I'd suggest to upgrade.
Johnny Mariéthoz
@jma
Hello I'm facing performance issue when I try to initialize an array with the 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.
19 replies
Ash McConnell
@AshMcConnell_twitter
Hi Folks, is there an ivy version of formly in the works?
Abdellatif Ait boudad
@aitboudad
Ash McConnell
@AshMcConnell_twitter
Ah sweet, thanks @aitboudad !
DaveDoqpal
@DaveDoqpal
image.png
Hey guys, what is the smartest way to provide dynamicly changeable formelements with seperate options. Any tips?
Johnny Mariéthoz
@jma
@DaveDoqpal if you can JSONSchema you can use a oneOf: https://formly.dev/examples/advanced/json-schema
1 reply
Tarun Sharma
@sparshbhardwaj:matrix.org
[m]
buttons are loading but they are not clickable
Tarun Sharma
@sparshbhardwaj:matrix.org
[m]

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
@sparshbha:matrix.org
[m]
Can someone please answer above question?
Vijay
@vijhhh2
I want to contribute to ngx formly but I am facing difficulty to set up a dev environment. can anyone send me steps to setup dev environment in mac if you are already done. Thanks in advance.
Craig Shearer
@craigsh
Is this still a good place to ask questions - looks like it's not active lately.
Abdellatif Ait boudad
@aitboudad
@craigsh yes or you may create a new issue in https://github.com/ngx-formly/ngx-formly

@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')

Craig Shearer
@craigsh
@aitboudad ok thanks. Just a couple of questions. What's the best way of forcing Formly to re-evaluate a "templateOptions.disabled" value - I have a field which renders a button as its template. When the button is clicked it gets disabled because I've sent a request off to the server and want to prevent users from clicking it again. Once the server request has completed, I want to re-enable the button. The only way I've found to do this is to re-set the form's value - e.g. form.setValue(form.getRawValue()) - which seems pretty hacky. Ideally I'd like to be able to assign an Observable to the templateOptions.disabled expression property, and have Formly subscribe to it, so as to re-evaluate the condition when the Observable emitted.
Abdellatif Ait boudad
@aitboudad
@craigsh its possible to pass an observable to disabled property through expressionProperties:
expressionProperties: {
  'templateOptions.disabled': of(true),
},
1 reply
Craig Shearer
@craigsh
Further to my question about expressionProperties and Observables, it doesn't see to work trying to use 'templateOptions.hidden': of(true) - and indeed, setting hidden: true in templateOptions doesn't work either. Looking at the source it seems that hidden is a supported templateOptions property, but I can't get this to work.
2 replies
What I've trying to do is use an Observable to control whether a field is hidden. I'm aware of hideExpression, but this doesn't support Observables.
Samiullah Khan
@technbuzz

Hi everyone, I want my model be like

model: {
  party: [
    {
      type: 35,
      name: 'abcd...'
    },
    {
      address: 'abc...'
    }
  ]
}

The party is recorded as an array. But the content is not repeated. How can I write fields for it?

Samiullah Khan
@technbuzz
Or may be, in repeated content, how can I hide certain fields?
lnkhrs
@lnkhrs
hi everyone. I have 2 checkbox fields, only one of them can be checked at a time (if i check one, the other should be unchecked). how can i achieve this?
maximLyakhov
@maximLyakhov
wolmos-mrbau
@wolmos-mrbau

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]+$/,