問(wèn)題描述
我正在使用 google 插件 Picker for Google Drive.我的想法是只選擇文件夾并獲取其 ID.
I'm using google the plugin Picker for Google Drive. My idea is select only the folders and get its ID.
目前不允許我選擇它們,現(xiàn)在只能進(jìn)入該目錄.我正在使用此代碼:
Currently not let me select them,now only enter into that directory. I am using this code:
function MenuCtrl($scope, $location, appId) {
var onFilePicked = function (data) {
$scope.$apply(function () {
if (data.action == 'picked') {
var id = data.docs[0].id;
$location.path('/edit/' + id);
}
});
};
$scope.open = function () {
var view = new google.picker.View(google.picker.ViewId.FOLDERS);
view.setMimeTypes('application/vnd.google-apps.folder');
var picker = new google.picker.PickerBuilder()
.setAppId(appId)
.addView(view)
.setCallback(angular.bind(this, onFilePicked))
.build();
picker.setVisible(true);
};
$scope.create = function () {
this.editor.create();
};
$scope.save = function () {
this.editor.save(true);
}
}
我怎樣才能在不進(jìn)入的情況下獲得選定的文件夾?
How could I get selected folder without going inside it?
非常感謝您的提前和問(wèn)候.
Thank you very much in advance and greetings.
推薦答案
我相信從 2014 年 1 月 15 日開始,Picker 要求設(shè)置 OAuthtoken,即.您需要包含setOAuthToken(oauthToken)".在您的 PickerBuilder 中
I believe that from 15th Jan 2014, the Picker requires that an OAuthtoken is set, ie. you need to include " setOAuthToken(oauthToken)." in your PickerBuilder
這篇關(guān)于使用 google Picker 選擇文件夾的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!