尝试使用奇特的ES6/模块开始一个新项目。我使用了gulp,ngAnnotate,browserify,angular-templatecache,等等。无论如何,我正在尝试实际运行我的基本设置和它
Error: [$compile:tpload] Failed to load template: components/unauthenticated-container/unauthenticated-container.component.html (HTTP status: undefined undefined)
http://errors.angularjs.org/1.6.1/$compile/tpload?p0=components%2Funauthent…ainer%2Funauthenticated-container.component.html&p1=undefined&p2=undefined
at angular.js:68
at l (angular.js:19730)
at s (angular.js:16648)
at angular.js:16692
at d.$eval (angular.js:17972)
at d.$digest (angular.js:17786)
at d.$apply (angular.js:18080)
at angular.js:1841
at Object.a [as invoke] (angular.js:4842)
at a (angular.js:1839)我不能理解的是,如果我在$templateRequest中放了一个断点,$templateCache就会包含我想要获取的模板。我能做到
$templateCache.get('components/unauthenticated-container/unauthenticated-container.component.html');得到我想要的模板。我不确定上面错误中的(HTTP status: undefined undefined)到底是什么意思。生成的用于填充templateCache的文件在我看来是正确的:
angular.module("templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("components/authenticated-container/authenticated-container.component.html","<div>Authenticated</div>\n");
$templateCache.put("components/unauthenticated-container/unauthenticated-container.component.html","<div>\n <div ui-view></div>\n</div>\n");}]);有没有什么明显的我遗漏的或者我可以尝试的?
发布于 2017-02-06 23:17:00
原来我的一个拦截器有一个错误,而$http没有发现这个错误。
https://stackoverflow.com/questions/42069586
复制相似问题