1๐
โ
You can use a {% verbatim %}
template block to prevent that Django parses that part of the template:
{% verbatim %}data-ng-href="#{{rc.prepareUrlParam(metric_group.title)}}" {% endverbatim %}
Alternatively, you can use the {% templatetag %}
template tag to output the literal {{
and }}
:
data-ng-href="#{% templatetag openvariable %}rc.prepareUrlParam(metric_group.title){% templatetag closevariable %}"
Both methods allow you to output a literal {{
or }}
from a Django template, which can then be parsed and handled by AngularJS.
๐คknbk
0๐
You need to double the braces {{
or }}
to output a single brace {
or }
. Can you try doing this:
#{{{{rc.prepareUrlParam(metric_group.title)}}}}"
Check this out:
>>> x = " {{ Hello }} {0} "
>>> print x.format(42)
' { Hello } 42 '
- Displaying image file from django model in jade
- Django โ AttributeError: 'module' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'
Source:stackexchange.com