Removal of data from the controller to the Angular js



  • Hello! I'm trying to make SPA an Annex on Django + Angular, built REST API, and as soon as I got to the public, I ran into the problem: Angular refuses to download the data from the controller to the template. I simplified my client's application to maximum, but the problem didn't solve:

    app.js

    var app = angular.module('uniApp', []);
    app.controller('uniController', function ($scope) {
      $scope.message = "some text";
    });
    

    index.html

    <!DOCTYPE html>
    <html ng-app="uniApp">
    <head>
        <meta charset="utf-8">
        <title>UNI DIGIT</title>
        <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.js"></script>
    </head>
    <body ng-controller="uniController">
     <h1>{{ message }}</h1>
     {% load staticfiles %}
     <script src="{% static 'js/shared/angular-ui-router.min.js' %}"></script>
     <script type="text/javascript" src="//cdn.jsdelivr.net/restangular/latest/restangular.js"></script>
     <script type="text/javascript" src="{% static 'js/app.js' %}"></script>
    </body>
    </html>
    

    File structure:

    main/
    --static/
      --js/
        --app.js    
    --templates/
      --main/
        --index.html
    

    When I try to do the same without Jango, it works, maybe it's him. But Jango's just giving the hotspot and the right violin. ♪ ♪



  • I forgot about the g {% verbatim %} before using Angular synthaxis.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2