HTML
<a href="#/menuItems"></a>
JavaScript
var app = angular.module('app', ['ngRoute', 'lr.upload', 'ui.bootstrap');
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'view/login.html',
controller: 'userController',
resolve: {
invoiceTypeRoute: function () {
return "ok";
}
}
})
}]);
controller / userController.js中的我的控制器“ userController”
index.html
<script src="js/lib/angular.js" type="text/javascript"></script>
<script src="controller/userController.js" type="text/javascript"></script>
此代码有效,但被告知这种方式是错误的,我该如何调用我的控制器而不是ng-controller?