After upgrading my Ionic app from version 3 to version 4, I encountered some camera issues. The following error appeared in the console when running ionic serve:
ERROR in src/app/register/register.page.ts(50,4): error TS2554: Expected 2 arguments, but got 1. [ng] src/app/register/register.page.ts(53,63): error TS2749: 'Camera' refers to a value, but is being used as a type here.
See the code snippet from register.ts:
import { Component, ViewChild, OnInit } from '@angular/core';
import { ScrollDetail } from '@ionic/core';
import { NavController, LoadingController, ToastController } from '@ionic/angular';
import { Http, Response, Headers, RequestOptions } from "@angular/http";
import { map } from 'rxjs/operators';
import { Observable } from 'rxjs/Observable';
import { SignaturePad } from 'angular2-signaturepad/signature-pad';
import { Storage } from '@ionic/storage';
import { Camera, CameraOptions } from '@ionic-native/camera';
@Component({
selector: 'app-register',
templateUrl: './register.page.html',
styleUrls: ['./register.page.scss'],
})
export class RegisterPage implements OnInit {
showToolbar = false;
capturedSnapURL:string;
// Rest of the code...
Can anyone assist me in identifying the issue in my code?