未捕获错误:[$ injector:unpr] http://errors.angularjs.org/undefined/$injector/unpr?p0=tProvider < - t < - $ http < - $ compile 除此之外没有其他消息。它发生在页面第一次加载时。 我运行ASP.NET MVC5,Angular 1.2RC3,并通过git推送到Azure。 谷歌没有打开任何有趣的东西。 有什么建议么? 编辑: 我使用TypeScript,并使用$ inject变量定义我的依赖关系,例如:
export class DashboardCtrl { public static $inject = [ '$scope','$location','dashboardStorage' ]; constructor( private $scope: IDashboardScope,private $location: ng.ILocationService,private storage: IDashboardStorage) { } }
我相信应该(或打算)绕过局部变量重命名在缩小过程中出现的问题,并可能导致此错误。
也就是说,它显然与缩小过程有关,当我在我的dev机器上设置BundleTable.EnableOptimizations = true时,我可以重现它。