如何让此设置正常工作?
var app = angular.module('app', ['ui.router', 'app.controllers']);
/* FooCtrl isn't available here, why not? */
var controllers = angular.module('app.controllers', []);
controllers.controller('FooCtrl', function ($scope, $log) {});
<script src="app.js"></script>
<script src="controllers.js"></script>
<!-- also tried swapping this order -->
答案 0 :(得分:0)
您的控制器不是全局构造函数,而是在模块内部定义,因此您需要使用语法。
controller: 'FooCtrl'
而不是
controller: FooCtrl