Angularjs 控制器功能未执行
控制器功能未执行 "严格使用",Angularjs 控制器功能未执行,angularjs,angularjs-scope,Angularjs,Angularjs Scope,控制器功能未执行 "严格使用", angular.module('newproejctApp') .controller('dashboardCtrl', function ($rootScope, $scope, User, Auth,dataService) { $scope.test="this is not working"; }); <div class="container" ng-controller="dashboardCtrl">
angular.module('newproejctApp')
.controller('dashboardCtrl', function ($rootScope, $scope, User, Auth,dataService) {
$scope.test="this is not working";
});
<div class="container" ng-controller="dashboardCtrl">
{{test}}
</div>
由于某种原因,上述示例将不起作用。该项目由约曼公司生产,所有其他控制器均正常运行 我认为您需要在模块定义中传入空数组:
angular.module('newproejctApp', [])
您在JS控制台中是否有任何错误?你确定newproejctApp不是打字错误吗?如果你设置了一个断点,它是否会碰到你设置$scope.test的那一行?js控制台、alertsomething、console.log中没有错误。我不知道如何调试它,它首先发生在我尝试将一些变量继承到子Ctrl并注释掉我意识到的所有东西时@jadarnel27上面的newproejctApp应该是newprojectApp吗?不,如果您的模块名称与项目的其他部分不一致,我很高兴通知您,我没有收到任何错误D