You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.
When I load a form fields form a JSON, is it better practice load the predefined fields values populating the JSON model or There are ways to fill them from the JSON of fields, like some property for example like predefined-value or something like that?
Is there a specific field in the JSON of fields where I can receive extra data from the server?
For example, data such as the modification date and the name of the person who made it. In general they are other data that do not have to do directly with the creation of the form.
Currently I add a new { .... } in the lis of field and it seem it works.
Thanks in advance
The text was updated successfully, but these errors were encountered:
falinsin
changed the title
Is it possible in the fields JSON to add predefined values for every every fields of teh form?
Is it possible in the fields JSON to add predefined values for every every fields of the form?
Nov 8, 2017
For example you can see properties name_type and code_type are extra data for my own use.
I insert all these new data inside templateOptions propertie and it is working.
It does not intercept with the generation of the form because it formly ignores them.
My question is :
Is there a specific or more appropriate variable in formly to insert this type of custom variables or is it correct as I am doing? I ask it just in case
data (object): This is reserved for the developer. You have our guarantee to be able to use this and not worry about future versions of formly overriding your usage and preventing you from upgrading :-)
Personally, I'd use data because, as you said, it's just extra data is not needed to manipulate the form.
Use templateOptions under your own risk; maybe formly adds a name_type or code_type in future versions and it break your implementation. With data that's not going to happen. 😄
I hope this helps!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Two simple questions
When I load a form fields form a JSON, is it better practice load the predefined fields values populating the JSON model or There are ways to fill them from the JSON of fields, like some property for example like predefined-value or something like that?
For example, data such as the modification date and the name of the person who made it. In general they are other data that do not have to do directly with the creation of the form.
Currently I add a new { .... } in the lis of field and it seem it works.
Thanks in advance
The text was updated successfully, but these errors were encountered: