结构如下:
-main.js
requirejs.config({
baseUrl: 'scripts',
paths: {
jQuery: 'lib/jquery/jquery',
Angular: 'lib/angular/angular',
angularRouter: 'lib/angular-route/angular-route',
},
shim: {
'Angular': {
deps: ['jQuery']
},
angularRouter: {
deps: ['Angular'],
exports: 'ngRoute'
}
}
});
// 手动开启angular服务
require(['Angular','app'], function(angular){
angular.element(document).ready(function(){
angular.bootstrap(document,['yce-manage']);
});
});
-app.js
define(['Angular','angularRouter'],function(angular){
var app = angular.module('yce-manage',['ngRoute']);
return app;
});
报错:
angular.min.js:108 Error: [ng:areq] http://errors.angularjs.org/1.4.3/ng/areq?p0=mainController&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
angular.min.js:108 Error: [ng:areq] http://errors.angularjs.org/1...
at Error (native)
mainController
not a function, got undefined
at Error (native)
angualr 不用依赖jquery吧