Cannot resolve all parameters for [OBJECT OBJECT], after the ion feed

I’m not sure what I’m doing wrong, but when I try to use ionic and Cordova plugins, I get the following error after the ionic feed: “cannot resolve all parameters for [OBJECT OBJECT], [OBJECT OBJECT], [OBJECT object], [OBJECT OBJECT] , [OBJECT OBJECT] ,? "

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();
  }
+4
source share
1 answer

I have the same problem, so I deleted the last constructor parameter and set it before the constructor. In your case, for example,

export class HomePage {

 public previewRect: CameraPreviewOptions;

 constructor(
  public navCtrl: NavController,
  public toastCtrl: ToastController,
  public file:File,
  public diagnostic:Diagnostic,
  public cameraPreview: CameraPreview   
 ) {
  this.checkPermissions();
 }
}

I do not know if this solution is correct, but it solved my problem.

+2
source

Source: https://habr.com/ru/post/1676116/


All Articles