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
Hi!
So I am trying to use a combination of angular-schema-form-ui-ace and $validators, and I am trying my best to not having to create a special plug-in for the job.
There problems:
How do I actually set the model value to the resulting object? The ace-component will set it as a string, so I will have to cut in between or at some stage and set the model. In this example, I desperately tried to set value to the object, however that is not a reference, or at least it doesn't look like that it worked.
Having a function declaration in the json makes it impossible to store it as plain json, I suppose that there is no way of dynamically refer to some function in, for example the controller scope?
This is what I do now. Setting value obviously doesn't work:
{key: "globals",type: "ace",aceOptions: {mode: 'json'},validationMessage: {'noGlobals': 'Globals contains invalid JSON'},$validators: {noGlobals: function(value){debugger;try{value=JSON.parse(value);returntrue;}catch(err){returnfalse;}}},title:"Global variables",description: "The global variables that is provided as input to the process"}
The text was updated successfully, but these errors were encountered:
Yes that is a problem. Currently you can't do that. What you can do is maybe to add a ˋ"format": "JSON"ˋ to the schema and a custom format validator function to the tv4 validator. That would get rid of the ˋ$validators, but not the ˋ$parsersˋ and
ˋ$formattersˋ...
I just realized that I might be going about this the wrong way.
What I was supposed to use this for was actually to edit a dictionary(or object), the only JSON-supported base type that can't be structurally edited by ASF.
The I also thinking about the form builder project, which will have to solve this problem. As it will have to be able to edit JSON objects structurally.
So perhaps what is needed is a "builder" that can edit JSON structures in general either way. If you got that, you could just theoretically plug that in here.
I will look at the $formatters and $parser as well, thanks for you help!
Hi!
So I am trying to use a combination of angular-schema-form-ui-ace and $validators, and I am trying my best to not having to create a special plug-in for the job.
There problems:
This is what I do now. Setting value obviously doesn't work:
The text was updated successfully, but these errors were encountered: