In the flask environment, whether you use angluar's ng-repeat; or vue's loop to traverse v-repeat, v-for; such an error will be reported, please solve it
<ul>
<li ng-repeat="x in time">
{{x.medicine}}
</li>
</ul>
Error message:
jinja2.exceptions.UndefinedError
UndefinedError: 'x' is undefined
给我你的怀抱2017-05-15 16:59:19
It looks like this. Jinja’s template uses {{}} to output variables, and angluar does the same. So when you want to output a variable, you have to consider who outputs it. If it is angluar output, you need to compare it. Bracket escaping, output the curly braces into html instead of being filtered out by the template engine
phpcn_u15822017-05-15 16:59:19
Just write it like this
{% raw %}
<ul>
<li ng-repeat="x in time">
{{x.medicine}}
</li>
</ul>
{% endraw %}