[英]Google Drive API sample app “DrEdit” javascript errors (Angular JS?)
我正在尝试在Google App Engine上设置由Google生成的名为“Dredit”的示例应用程序。 这里的文档: https : //developers.google.com/drive/examples/python
该应用程序应该能够从用户的Google Drive文件夹中打开,创建和编辑文件。
除了主页控制台中出现的一些JavaScript错误外,几乎所有内容都可以正常工作。 此外,当我尝试创建新文档时,我无法更改文档的标题,也无法编辑现有文档的名称。 但是,它允许我编辑任何文档的内容。 为了亲眼看看,该应用程序位于: http : //www.dredit-python-0515.appspot.com 。 您需要Google帐户才能登录。
Chrome的JS控制台和Firebug中的错误不同,但它们似乎以我的项目目录中的angularJS文件为中心。
Chrome中的错误是:
TypeError:无法读取undefined的属性'editable'
at Object.service.state(http://dredit-python-0515.appspot.com/js/services.js:135:37)
在http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:6128:19
在运营商。| (http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:5560:74)
在http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:5879:14
at Object.fn(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:4788:22)
在Object.Scope。$ digest(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:7654:38)
at Object.Scope。$ apply(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:7855:24)
完成后(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8844:20)
at completeRequest(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8984:7)
在XMLHttpRequest.xhr.onreadystatechange(http://dredit-python-0515.appspot.com/lib/angular-1.0.0/angular-1.0.0.js:8954:11)
任何帮助是极大的赞赏!
我无法让你的应用程序工作,但查看堆栈跟踪:
错误来自该行
} else if (!doc.info.editable) {
return EditorState.READONLY;
}
在http://dredit-python-0515.appspot.com/js/services.js
调用此代码时,未定义doc.info。
无论出于何种原因,在设置doc.info对象的“createEditor”函数之前调用“state”函数。
最简单的解决方法是用第135行替换“else if”
} else if (doc.info && !doc.info.editable) {
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.