I'm trying to integrate AngularJs with an existing Django application. this is my first attempt with Angular.
Here is the code:
<!-- HTML (section)-->
<fieldset class="module aligned">
<h2>Document's sections</h2>
<div class="form-row document-nodes" ng-app="DocumentNodesApp">
<div style="width: 100%; min-height: 450px;" ng-controller="NodeController">
<form id="changelist-form" action="" method="post" novalidate>{% csrf_token %}
<div id="tree"
data-url="{{ tree_json_url }}"
data-save_state="{{ app_label }}_documentnode"
data-auto_open="{{ tree_auto_open }}"
data-autoescape="{{ autoescape }}"
>
</div>
</form>
<div id="node-container">
{$node_title$}
</div>
</div>
</div>
</fieldset>
// javascript
var app = angular.module('DocumentNodesApp', []);
app.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('{$');
$interpolateProvider.endSymbol('$}');
});
var nodeController = app.controller(
'NodeController',
function($scope){
$scope.node_name = "Bla Bla bla!";
});
What I'm doing wrong?
the variable node_title is not replaced with the value assigned. I've also tried to use the normal angular templating filters {{ }}, by sorrounding the angular variable with the django template filter verbatim, but I had the same result.
Anybody has experienced the same problems and can help me?
thanks LuKe