我有一个MVC 5应用程序捆绑了我的角应用程式,例如例如:角捆绑/ MVC通过精缩无法加载主模块
var angular = new ScriptBundle("~/App")
.Include("~/App/app.js")
.IncludeDirectory("~/App", "*.js", true);
bundles.Add(angular);
然后呈现它的头部,所有其他资源后加载,在这里:
(jquery, angular.min.js, other resources)
@Scripts.Render("~/App")
切换打开我的web.config的调试属性设置为false:
<compilation debug="false" targetFramework="4.5.2" />
主要模块我的角度应用程序不加载:
Error: [$injector:nomod] Module 'wdf' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
之前你链接我如何确保角度将缩小的形式加载,要知道我已经三重检查每一个工厂,控制器,服务[你的名字文档它],为AngularJS's documentation中列出的正确语法。我也减少了我的整个角申请下来到一个单独的文件和一行,以消除可能的其它注射错误:
(function() {
'using strict';
var app = angular.module('wdf', []);
})();
我也一直在HTML表述为这样的应用:
<!DOCTYPE html>
<html ng-app="wdf" ng-strict-di>
...
即使使用ng-strict-di
,应用程序仍可以非常精细地运行。我一直在摔跤几个小时。每个线程我基本上可以挖告诉我,确保我已经宣布所有模块的依赖关系的权利,但我敢肯定,我已经考虑:
ng-strict-di
还没有抓到任何东西我应该有更好的编码- 我三重检查每一个受诅咒的文件,以确保我已经按照最佳做法缩小
- 最后,应用程序甚至不工作这是最简单的形式