Uncaught TypeError: undefined is not a function In AngularJS
Posted
技术标签:
【中文标题】Uncaught TypeError: undefined is not a function In AngularJS【英文标题】: 【发布时间】:2015-09-18 20:55:12 【问题描述】:我的应用运行良好。但是我使用了http://ruhley.github.io/angular-color-picker/ 的颜色选择器,出现了一些问题。现在我的应用程序也无法启动。我删除了这个颜色选择器仍然一样。 我得到的错误是
Uncaught TypeError: undefined is not a function inside angular.js at
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;//<<------GETTING ERROR HERE
finally
path.shift();
【问题讨论】:
是说函数getservice不是函数?它究竟指向哪个部分未定义 【参考方案1】:通过将 angular-cookies 和 angular-resource 都更新到 1.4.0 来解决问题
【讨论】:
以上是关于Uncaught TypeError: undefined is not a function In AngularJS的主要内容,如果未能解决你的问题,请参考以下文章
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'fingerprint') Laravel Live
如何解决问题:Uncaught (in promise) TypeError: promisify is not a function?
Uncaught TypeError: Cannot redefine property: $router
Uncaught TypeError: o.block is not a function
Laravel 5.1 和 Vue.js - 21678 Uncaught (in promise) TypeError: Cannot read property 'data' of null