のすべてのパラメータを解決できません。そのため、私は私のサービスで「ファイル」を使用すると、私はエラーを取得https://ionicframework.com/docs/native/file/は私が<a href="https://ionicframework.com/docs/native/file-transfer/" rel="nofollow noreferrer">https://ionicframework.com/docs/native/file-transfer/</a></p> <p>を実装しようとしているファイル
をインストールする必要があります。
できますFile:(?、?、?、?、?)のすべてのパラメータを解決しません。
疑問符は循環参照に似ていることは知っています。他の場所で私のサービスを利用することは決してありません。以前は「ファイル」を使用していませんでした。
import {Injectable} from '@angular/core';
import {File} from "@ionic-native/file";
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
@Injectable()
export class ImageService {
constructor(private file: File, private transfer: FileTransfer) {
}
public getImagesOfSchedule() {
const fileTransfer: FileTransferObject = this.transfer.create();
const url = 'http://techbooster.be/wp-content/uploads/2017/11/logo-long-white.png';
fileTransfer.download(url, this.file.dataDirectory + 'file.pdf').then((entry) => {
console.log('download complete: ' + entry.toURL());
}, (error) => {
// handle error
});
}
}
app.module.ts
providers: [
StatusBar,
AuthenticationService,
ScheduleService,
ToastService,
StorageService,
FacebookService,
GoogleService,
ImageService,
Facebook,
GooglePlus,
PushService,
File, <----------------
FileTransfer, <--------------
Push,
ScreenOrientation,
{
provide: HttpService,
useFactory: HttpFactory,
deps: [XHRBackend, RequestOptions]
},
{
provide: HttpNoAuthService,
useFactory: HttpFactory,
deps: [XHRBackend, RequestOptions]
},
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}