Angularjs 警告:尝试多次加载角度。-咕哝
我的管道如下所示:Angularjs 警告:尝试多次加载角度。-咕哝,angularjs,gruntjs,sails.js,bower,pipeline,Angularjs,Gruntjs,Sails.js,Bower,Pipeline,我的管道如下所示: // Client-side javascript files to inject in order // (uses Grunt-style wildcard/glob/splat expressions) var jsFilesToInject = [ // Dependencies like sails.io.js, jQuery, or Angular 'js/dependencies/sails.io.js', 'js/bower_components
// Client-side javascript files to inject in order
// (uses Grunt-style wildcard/glob/splat expressions)
var jsFilesToInject = [
// Dependencies like sails.io.js, jQuery, or Angular
'js/dependencies/sails.io.js',
'js/bower_components/angular/*.js',
'js/bower_components/**/*.js',
// All of the rest of your client-side js files
// will be injected here in no particular order.
'js/modules/app.js',
'js/modules/auth/services/accessLevels.js',
'js/**/*.js'
];
还有my bower.json:
{
"name": "myapp",
"version": "0.0.1",
"dependencies": {
"angular": "1.3.7",
"angular-cookies": "1.3.7",
"angular-ui-router": "0.2.15"
},
"resolutions": {
"angular": "1.3.7"
}
}
我认为这个问题是因为它正在注入angular.js和angular.min.js,有没有办法用grunt解决这个问题?页面中有没有硬编码的脚本标记?删除“js/bower\u components/angular/*.js”。为什么?如果我真的删除了它,脚本将不会按特定顺序被注入,angular也不会在我的应用程序之前被调用,这将打破一百万个和平。此外,我注入了一个特定的文件(angular),然后是bower_Components/***.s,这并不意味着angular将在您不想要的文件上被称为againfront bang<代码>'!js/bower\u components/angular/angular.min.js'我认为在grunt中也是一样的,我只使用了gulp,但这在globbing模式中很常见。