Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

408
Visualizações
Angular 2, Ionic. Can't resolve all parameter for HomePage

What am I missing in the following? I'm trying to use cordova-camera-plugins and ionic native, with Ionic 2 but I receive the following Runtime Error after ionic serve: "Can't resolve all parameters for HomePage: ([object Object], [object Object], [object Object], [object Object], ?)."

Home.ts

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',

})

@Injectable()
export class HomePage {

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

app.module.ts

import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';


import { HomePage } from '../pages/home/home';
import { Diagnostic } from '@ionic-native/diagnostic';


import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

@NgModule({
  declarations: [
    MyApp,
    HomePage,
  ],
  imports: [
     BrowserModule,
     IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
    entryComponents: [
     MyApp,
     HomePage,
     Diagnostic
  ],
  providers: [
    StatusBar,
    SplashScreen,
    Diagnostic,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    {provide: Diagnostic, useClass: Diagnostic}
   ]
})
export class AppModule {}
about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I used to get that same error and now it's fixed. "Can't resolve all parameters for HomePage: ([object Object], [object Object], [object Object], [object Object], ?).".

The "?" might mean not recognize or something, so try removing some parameters in the constructor and just declare them as normal data member( above the constructor). For example, "public previewRect: CameraPreviewOptions".

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda