I am using Zxing Scanner component in Angular version 12. I faced this error in many places..
/**
* Returns a valid BarcodeFormat or fails.
*/
private getBarcodeFormat(format: string | BarcodeFormat): BarcodeFormat {
return typeof format === 'string'
? BarcodeFormat[format.trim().toUpperCase()]
: format;
}
Error is in this line [format.trim().toUpperCase()]
and when I hover it will show Element implicitly has an 'any' type because index expression is not of type 'number'.ts(7015)
.
Why this error came?? How do I resolve it??
I need a perfect solution without change any configuration in my angular.json or package.json