Replies: 1 comment
-
Why not simply modify your partial so that it takes as input your schema field? That way you could do something like: {% include "partials/input.html" with field=schema.email, label="My input" %} Additionally, you can make use of the <div class="form-group">
<label for="paperInputs1">{{ label }}</label>
<input type="text" {% if field.errored? %}class="background-danger"{% endif %} name="{{ field.id }}" value="{{ field.value }}"{% if field.required? %} required{% endif %}>
{% for error in field.errors %}<p class="text-danger">{{ error.message }}</p>{% endfor %}
</div> Otherwise, dynamic property lookups using square brackets are not supported in templates presently. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to create an input component.
Using the dot notation (
schema.email.errors
), it's not possible to dynamically set the field name for the displayed error message. Is there some solution that could dynamically retrieve a property? E.g.name="email"
thenschema[name].errors
.Beta Was this translation helpful? Give feedback.
All reactions