Answer the question
In order to leave comments, you need to log in
Why doesn't Django and AngularJS work together?
<!DOCTYPE html>
<html data-ng-app="App">
<head>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body data-ng-controller="TestController">
<table id="hotels">
<tr>
<th>Hotel Name</th>
<th>Star Rating</th>
<th>Hotel type</th>
<th>Hotel Price</th>
</tr>
<tr data-ng-repeat="hotel in hotels | filter:search.type1 | filter:search.type2">
<td>{{hotel.name}}</td>
<td>{{hotel.star}}</td>
<td>{{hotel.type}}</td>
<td>{{hotel.price}}</td>
</tr>
</table>
<br/>
<h4>Filters</h4>
<input type="checkbox" data-ng-model='search.type1' data-ng-true-value='luxury' data-ng-false-value='' /> Luxury
<input type="checkbox" data-ng-model='search.type2' data-ng-true-value='double suite' data-ng-false-value='' /> Double suite
</body>
</html>
Answer the question
In order to leave comments, you need to log in
<td>{{ '{{' }}hotel.name{{ '}}' }}</td>
<td>{{ '{{' }}hotel.star{{ '}}' }}</td>
<td>{{ '{{' }}hotel.type{{ '}}' }}</td>
<td>{{ '{{' }}hotel.price{{ '}}' }}</td>
{% verbatim %}
<td>{{hotel.name}}</td>
<td>{{hotel.star}}</td>
<td>{{hotel.type}}</td>
<td>{{hotel.price}}</td>
{% endverbatim %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question