0

I have following code in my django template :

<li class="item" ng-repeat="(key, value) in products" style=" ">
    <a href="{% url 'appname:productdetail' 150 %}" class="icon">View</a>
</li>

here 150 is value.id which i would access as {$value.id$} as I am using interpolate provider.

but I can't write something like:

<a href="{% url 'appname:productdetail' {$value.id$} %}" class="icon">View</a>

as it is npot valid for template.

I am stuck that how I can create URL in template using angular expression. Any suggestions or help would be appreciated.

Always_a_learner
  • 4,585
  • 13
  • 63
  • 112

1 Answers1

0

This is the way I have found so far:

<a href="{% url 'appname:productdetail' ''%}{$value.id$}/" class="icon">View</a>

In some cases it can work without empty quotes.

Always_a_learner
  • 4,585
  • 13
  • 63
  • 112