我在使用ui-router加载按需控制器js文件时遇到问题,并且错误地说:
参数'FormController'不是
我的代码是:
'use strict';
var Request = angular.module('Request',['ui.router','oc.lazyLoad'])
.config(function($stateProvider) {
$stateProvider.state('form', {
url: "/form",
templateUrl: "view/form1.html",
controller:'FormController as form',
resolve: {
form: function( $ocLazyLoad ){
return $ocLazyLoad.load(
{
name:'form',
files:['app/controller/FormController.js']
}
)
}
}
});
我的控制器是:
'use strict';
Request.controller('FormController',function($scope){
$scope.text = 'This is Form Controller';
})
答案 0 :(得分:2)
我解决了这个解决方案的问题:
将logging.level.org.springframework=ERROR
logging.level.com.foo=ERROR
更改为app.controller