Answer the question
In order to leave comments, you need to log in
How to use Angular under Django?
$scope.details.pics = [{
picture: '/media/OrderPicture/130/15480__e1a4d2fc26070b832cf0e1a59f70a9bd.jpg',
thumbnail: '/media/cache/e5/98/e5989c3a9ed2520ead1bb8b8558774ba.jpg'
},
{
picture: 'http://www.kartoshka.com/sites/default/files/kk4.jpg',
thumbnail: 'http://www.kartoshka.com/sites/default/files/kk4.jpg'
}];
<li ng-repeat="pic in details.pics">
<a ng-href="pic.picture" ><img ng-src="pic.thumbnail"/></a>
<a ng-href="pic.picture" ><span class="ui-icons icons-attached-file h-m-r"></span></a>
</li>
<li ng-repeat="pic in details.pics" ng-class="pic.picture"></li>
Answer the question
In order to leave comments, you need to log in
I do not know about jango, but in twig, where the same brackets are used in the server-side template engine, there is such a solution
. output brackets for angular as a string
I have a bomb.
I didn’t even know the python, after googling for 15 seconds I understood.
The Django template language syntax uses four constructs.
Variables are separated by {{ and }}, for example:
For context {'first_name': 'John', 'last_name': 'Doe'}
, the template renders:
Dictionary keys, object attributes, and list elements are accessed through a dot:
{{ my_dict.key }}
{{ my_object.attribute }}
{{ my_list.0 }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question