Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 带有.NET MVC绑定缩小错误的AngularJS_Asp.net Mvc_Angularjs_Bundle - Fatal编程技术网

Asp.net mvc 带有.NET MVC绑定缩小错误的AngularJS

Asp.net mvc 带有.NET MVC绑定缩小错误的AngularJS,asp.net-mvc,angularjs,bundle,Asp.net Mvc,Angularjs,Bundle,我一直在一个.NETMVC网站内开发一个大型AngularJS应用程序。我已经走了很长的路,没有测试它是否会成功地使用捆绑优化功能缩小 BundleTable.EnableOptimizations = True 当然,它失败了。我一直在按照绑定脚本的顺序进行操作,并确保在控制器名称中使用字符串文字(我没有,这是我必须做的大量重分解) 但是如果没有“未知提供者”错误,我无法将我的核心脚本放到Minifiy 下面是确切的错误: 未捕获错误:[$injector:modulerr][$inject

我一直在一个.NETMVC网站内开发一个大型AngularJS应用程序。我已经走了很长的路,没有测试它是否会成功地使用捆绑优化功能缩小

BundleTable.EnableOptimizations = True
当然,它失败了。我一直在按照绑定脚本的顺序进行操作,并确保在控制器名称中使用字符串文字(我没有,这是我必须做的大量重分解)

但是如果没有“未知提供者”错误,我无法将我的核心脚本放到Minifiy

下面是确切的错误: 未捕获错误:[$injector:modulerr][$injector/modulerr?p0=ppAccount&p1=Error…红色脚本%3Fv%3DknV3wkCOg32ajaw4GwiRSrTXdo8Ue7MRIn65CPYa1b81%3A1%3A379851]

以下是失败的捆绑包配置:

            bundles.Add(new ScriptBundle("~/bundles/PilotPartnerRequiredScripts")
      .Include(
          "~/UI/js/jquery/jquery-2.1.3.js",
          "~/UI/js/plugins/jquery-ui/jquery-ui.js",
          "~/UI/js/bootstrap/bootstrap.js",
          "~/UI/js/plugins/pace/pace.min.js",
          "~/UI/js/plugins/slimscroll/jquery.slimscroll.js",
          "~/UI/js/inspinia.js",
          "~/UI/js/angular/angular.js",
          "~/UI/js/ui-router/angular-ui-router.js",
          "~/UI/js/bootstrap/ui-bootstrap-tpls-0.12.1.js",
          "~/UI/js/angular/angular-resource.js",
          "~/UI/js/angular/angular-sanitize.js",
          "~/UI/js/angular/angular-route.js",
          "~/UI/js/plugins/switchery/switchery.js",
           "~/UI/js/plugins/angular-ui-switch/angular-ui-switch.js",
           "~/UI/js/plugins/angularLocalStorage/angular-local-storage.js",
           "~/UI/js/plugins/ngDialog/ngDialog.js",
           "~/Scripts/ngTags/ng-tags-input.js",
           "~/Scripts/uiSortable/sortable.js",
           "~/Scripts/kendo/2014.3.1119/kendo.all.min.js",
           "~/Scripts/xeditable/xeditable.js"
就我的一生而言,我不知道哪个依赖关系没有得到解决。我觉得如果我能把它缩小到一个特定的依赖性,我知道我可以解决这个问题

有没有办法追踪导致问题的特定模块

有没有关于如何使这项工作的建议


感谢您的帮助。

在注入依赖项(数组表示法)时,您应该始终遵循严格的di

Angualar Doc提到,在进行缩小时一定要遵循严格的DI,否则会破坏你的应用程序

例如(代码)


在上面的代码片段中,我遵循了DI的内联数组表示法,它已应用于各种角度组件,只是为了演示它。无论在何处注入依赖项,您都应该确保遵循它。

在Angular中,您的注入是安全的吗?我没有这样做,当它失败时,这是我开始尝试的第一件事。我浏览了整个AngularJS应用程序(我的整个应用程序中有多个),然后将其替换掉。到目前为止运气不好。但我可能错过了一个。我会坚持下去。但似乎Angular Animate也给我带来了问题。它一直无法最小化。做了更多的挖掘。正是这样。我发现我的App.config没有使用严格的DI,这就是问题的原因。这就是我设置$routeProvider的地方。
angular.module('myModule', [])
.factory('serviceId', ['depService', function(depService) {
  // ...
}])
.directive('directiveName', ['depService', function(depService) {
  // ...
}])
.filter('filterName', ['depService', function(depService) {
  // ...
}]);