I'm building an application that needs to render a dynamic form.
The form data comes from a json
, and in it, I have the fields configuration.
Here's an example:
{
"Fields": [
{
"title": "Assunto",
"type": "text"
},
{
"title": "Email da tia",
"type": "email",
}]
}
Is there any way to dynamically create policies, using attribute or class, setting high priority?
For example:
<section ng-repeat="field in Fields">
<field-builder data-type="field.type"></field-builder>
</section>
And in this directive, field builder, it generates directives returning for example (with minor priority):
<span class="text"></span>
<span class="email"></span>
Of course, a way to compile each one after ng-repeat.
Any way to do this?