-4

I have created one html file in which angular js code has been located and another backend file is there. Url is working properly. but i am not able to use {{ }} in html. What is the reason for that? And when i am getting response from backend file is always none. But data is passing correctly in request header.

4
  • This is impossible to address. If you are using angular.js I recommend taking a look at django-rest-framework. Commented Feb 2, 2015 at 13:51
  • check this question Commented Feb 2, 2015 at 13:54
  • I am not able to print values in ng-repeat block using {{ }} Commented Feb 2, 2015 at 14:14
  • I am also not able to get request back from views.py file. whenever i am alerting result of success is always none Commented Feb 2, 2015 at 14:15

2 Answers 2

1

I would recommend to use Angular JS and Django with the Django REST framework. That way you have the backend and frontend separated. Here are some links to get you started:

Getting Started with Django Rest Framework and AngularJS: http://blog.kevinastone.com/getting-started-with-django-rest-framework-and-angularjs.html

http://www.django-rest-framework.org/

Sign up to request clarification or add additional context in comments.

Comments

0

This is because the AngularJS renderer and Django template engine share the same token for variable substitution in templates.

Use verbatim block to stop the template from Django template rendering.

4 Comments

I have tried that still i am not getting output..
post your code, otherwise it's hard to understand
<script src= "ajax.googleapis.com/ajax/libs/angularjs/1.2.26/…> <body> <div ng-app="" ng-controller="customersController"> <ul> <li ng-repeat="x in names"> {{ x.Name + ', ' + x.Country }} </li> </ul> </div> <script> function customersController($scope,$http) { $http.get("/angu_json/") .success(function(response) {$scope.names = response;}); } </script>
And I have send json like {"stat": "true", "result": [{"name": "krunal", "id": 2}, {"name": "umang", "id": 3}]}

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.