I'm trying to integrate AngularJS with an existing Django application. 

This is my first attempt with Angular, I'm a newbie so be patient please.

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', []);


// the following is needed to avoid the clashing between django and angular 
templating systems, since

// both uses '{{' and '}}'

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

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to