Javascript AngularJS不显示范围数据

Javascript AngularJS不显示范围数据,javascript,angularjs,Javascript,Angularjs,我对动态放置的模板有问题 我的index.HTML的HTML如下所示: <body data-ng-controller="MainController"> <data-ng-include id="outside" src="dynamicTemplate()"></data-ng-include> </body> app.controller("FormController", ['$scope', '$http', '$window',

我对动态放置的模板有问题

我的index.HTML的HTML如下所示:

<body data-ng-controller="MainController">
<data-ng-include id="outside" src="dynamicTemplate()"></data-ng-include>
</body>
  app.controller("FormController", ['$scope', '$http', '$window', function($scope, $http, $window) {
    $scope.message = "";




    $scope.processForm = function() {
      $scope.message = "Processing form";
      $scope.messageStyle = {
        "color": "green"
      };
      // Ajax Logic to process form
      .success(function(data) {
        $scope.message = data.msg; /* Message never gets updated in the view */


      });

    };



  }]);

这里的问题是,$scope.message在调用FormController后,从不在data ng bind=消息中显示任何数据。我认为问题在于范围不知道它属于哪个控制器。我怎样才能解决这个问题

前面有Main,后面有formControllerhere@BrettFormController嵌套在此处的主控制器中。此处有些不太正确。您是否嵌套控制器并试图从另一个控制器中的一个$scope访问某些内容$作用域未共享。@Claies我正在尝试将$scope of data ng bind=message分配给FormController,但我不知道如何执行。为什么不将home.html的整个代码包装在一个中,并将ng控制器移动到该元素而不是该元素?
  app.controller("FormController", ['$scope', '$http', '$window', function($scope, $http, $window) {
    $scope.message = "";




    $scope.processForm = function() {
      $scope.message = "Processing form";
      $scope.messageStyle = {
        "color": "green"
      };
      // Ajax Logic to process form
      .success(function(data) {
        $scope.message = data.msg; /* Message never gets updated in the view */


      });

    };



  }]);