簡體   English   中英

Google Drive API示例應用“DrEdit”javascript錯誤(Angular JS?)

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM