【发布时间】:2015-08-20 11:32:42
【问题描述】:
我有一个 Angular 1.3.15 应用程序,它不能在 Internet Explorer 9 上运行,我收到一个 Unable to get property 'replace' of undefined or null reference 错误,它指向 angular 核心中的这段代码。
抛出的错误是正确执行的,但我不知道这个函数通常做什么以及在 IE9 上缺少什么才能正常工作。
function createInternalInjector(cache, factory) {
function getService(serviceName, caller) {
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) {
throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
serviceName + ' <- ' + path.join(' <- '));
}
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
cache[serviceName] = INSTANTIATING;
return cache[serviceName] = factory(serviceName, caller);
} catch (err) {
if (cache[serviceName] === INSTANTIATING) {
delete cache[serviceName];
}
throw err;
} finally {
path.shift();
}
}
}
作为最后一点,我已经包含了 es5-shim 和 shams,我已经使用了 data-ng-* 属性我已经阅读了多篇关于让 Angular 在 IE9 上工作的文章,但没有一篇描述类似于这个的问题所以我只剩下在SO上问这个问题了。
【问题讨论】:
-
你能粘贴你最终调用这个的代码吗?
-
@MathewBerg 我的代码没有明确调用它,它是自动运行的,我认为它找不到要注入的服务。
标签: javascript angularjs internet-explorer internet-explorer-9