You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to turn off strictNullChecks in your tsconfig to ignore the null checking
OR
You can just define it like this public webcamImage: WebcamImage | undefined;
https://ibb.co/TcPSL6b
In app.component.ts I imported WebcamImage.
import {WebcamImage} from 'ngx-webcam';
As like the tutorial when I use this WebcamImage as public , it returns this error.
Type 'null' is not assignable to type 'WebcamImage'
what is the reason of this error?
Total code in here.
import { Component } from '@angular/core';
import {Subject, Observable} from 'rxjs';
import {WebcamImage} from 'ngx-webcam';
@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public webcamImage: WebcamImage = null;
handleImage(webcamImage: WebcamImage) {
this.webcamImage = webcamImage;
}
}
The text was updated successfully, but these errors were encountered: