试图连接/丑化我的angular
应用程序使用gulp
在过去的几个小时里,我将整个过程简化为简单的 concat,甚至将角度文件从 concat 过程中删除到单独的<script>
标头中的请求 - 但我仍然收到相同的错误:
未捕获的类型错误: angular.module(...).factory(...) 不是一个函数
没有 concat 一切都很好。
我的任务:
gulp.task('JS', function() {
gulp.src(['!_dependencies/angular.min.js', '_dependencies/jquery.min.js', '_dependencies/moment.min.js', 'Alpha/_lilhelpers.js', 'Alpha/routes.js' , '!trainerreg.js', '**/*.js'], {cwd: './public/scripts'})
.pipe(concat('concat.js'))
.pipe(gulp.dest('./public/min'));
});
看来错误基本上一旦发生.factory
出现在代码中。
这是它当前因错误而停止的行 - 这是一个缩小的代码,但我没有缩小它,我现在只是连接文件,包括angular-animate.min
这行代码来自其中(实际上是第一行)。
如果我删除angular-animate
它只会向即将到来的另一家工厂抛出错误。
(function(N,f,W){'use strict';f.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(X,r,g){g=g.ngAnimateChildren;f.isString(g)&&0===g.length?r.data("$$ngAnimateChildren",!0):X.$watch(g,function(f){r.data("$$ngAnimateChildren",!!f)})}}).factory("$$animateReflow",["$$rAF","$document",function(f,r){var g=r[0].body;return function(r){return f(function(){r(g.offsetWidth)})}}]).config...
UPDATE:哦,我错了,它不是一遇到.factory就坏了;一旦遇到连接文件的缩小部分中的.factory,它就会中断...
将很高兴听到任何解决方案/假设!