我不知道我做错了什么,但是在尝试使用离子和Cordova插件时,我在离子发送后收到以下错误:“无法解析[object OBJECT],[object OBJECT],[object OBJECT]的所有参数, [object OBJECT],[object OBJECT],?“ im
import { Component, Injectable } from '@angular/core'; import { NavController } from 'ionic-angular'; import { ToastController } from 'ionic-angular'; import { File } from '@ionic-native/file'; import { Diagnostic } from '@ionic-native/diagnostic'; import { CameraPreview, CameraPreviewOptions, CameraPreviewDimensions} from '@ionic-native/camera-preview'; declare var cordova: any; @Component({ selector: 'page-home', templateUrl: 'home.html', providers: [CameraPreview, Diagnostic] }) export class HomePage { constructor( public navCtrl: NavController, public toastCtrl: ToastController, public file:File, public diagnostic:Diagnostic, public cameraPreview: CameraPreview, public previewRect: CameraPreviewOptions ) { this.checkPermissions(); }我在某处遇到了同样的问题,所以我删除了构造函数的最后一个参数并在构造函数之前给出了它.在你这样的情况下,
export class HomePage { public previewRect: CameraPreviewOptions; constructor( public navCtrl: NavController, public toastCtrl: ToastController, public file:File, public diagnostic:Diagnostic, public cameraPreview: CameraPreview ) { this.checkPermissions(); } }
我不知道这是否是正确的解决方案,但解决了我的问题.