使用AngularJS
创建mozilla浏览器扩展时,在响应遇到错误时使用$http
请求服务调用时。
这是我在请求$http
时使用的内容:
错误:' setTimeout'调用了一个没有实现的对象 界面窗口。
Browser/self.defer@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:6241:17
$RootScopeProvider/this.$get</Scope.prototype.$evalAsync@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:17719:11
$QProvider/this.$get</<@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:16291:7
scheduleProcessQueue@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:16399:5
qFactory/<.$$resolve@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:16432:11
qFactory/<.resolve@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:16415:9
simpleBind/<@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:16368:7
resolvePromise@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:11843:10
resolveHttpPromise@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:11824:11
done@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:11830:11
completeRequest@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:12033:7
requestLoaded@resource://gre/modules/ExtensionContent.jsm -> moz-extension://cb6087c3-cd93-43d0-b239-0681ece93f36/dotAlign_Project/app/lib/angular/angular.js:11966:9
答案 0 :(得分:0)
我得到了问题的原因, 由于在'Angular Library'中使用'window'对象,此错误即将发生。 因此,为了解决这个问题,我用'$ window'替换了'window'对象。