本文整理匯總了TypeScript中@ionic-native/file.File.createDir方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript File.createDir方法的具體用法?TypeScript File.createDir怎麽用?TypeScript File.createDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ionic-native/file.File
的用法示例。
在下文中一共展示了File.createDir方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Error
}).catch(error => {
return FILE.createDir(basePath, BLOB_CACHE_DIR, true).then(dirEntry => {
return desiredPath
}).catch(error => {
throw new Error('Could not create blob cache directory.')
})
})
示例2: resolve
}).catch(error => {
console.log('Directory does not exists! ' + error.message);
this.file.createDir(path, directoryName, false).then((result:any) =>{
path = path + directoryName + '/';
console.log('Directory: ' + path + ' created!');
resolve(path);
}).catch(error=>{
console.log('Directory creation error! ' + error.message);
resolve(path);
});
});
示例3:
}).then((): any => {
if (!zip.files || !Object.keys(zip.files).length) {
// Nothing to extract.
return 0;
}
// First of all, create the directory where the files will be unzipped.
const destParent = destination.substring(0, source.lastIndexOf('/')),
destFolderName = destination.substr(source.lastIndexOf('/') + 1);
return this.file.createDir(destParent, destFolderName, false);
}).then(() => {
示例4: Observable
return new Observable(observer => {
this.file.createDir(this.file.dataDirectory, dirPath, replace)
.then((success: DirectoryEntry) => observer.next(success))
.catch((error) => observer.error(error));
});