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
Inside templates/meld/todo.html, can I use {% meld 'counter' %} tag to have a nested component?
Example:
<!-- templates/meld/todo.html --><div><formmeld:submit.prevent="add" class="form-inline"><divclass="form-group"><labelfor="todo-input" class="form-label">Add a new todo</label><inputmeld:model.defer="todo_input" id="todo-input" type="text" autofocus><buttontype="submit" class="btn btn-primary inline">Add</button></div></form>
{% meld 'counter' %}
<h2>Your todos</h2>
{% for todo in todos %}
<liclass="mb-1 flashes"><divclass="card"><divclass="card-body"><buttonmeld:click="delete('{{ todo.id }}')" class="btn btn-danger mx-3">Remove</button>
{{ todo.todo }}
</div></div></li>
{% endfor %}
</div>
Currently when I try this, I get a KeyError:
venv\Lib\site-packages\flask_meld\component.py", line 257, in _set_values element.attrs["value"] = context_variables[element.attrs[model_attr]]KeyError: 'state'
The text was updated successfully, but these errors were encountered:
I haven't implemented nesting meld tags but it is a feature I would love to support. I'll look into this.
mikeabrahamsen
changed the title
Is it possible to use jinja meld tag inside another meld template?
Allow ability to have nested components
May 17, 2021
Inside
templates/meld/todo.html
, can I use{% meld 'counter' %}
tag to have a nested component?Example:
Currently when I try this, I get a KeyError:
The text was updated successfully, but these errors were encountered: