Я импортировал instascan библиотеку в Индекс. html файл,
<script type="text/javascript" src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"> </script>
У меня есть код в моем app.component. html как ниже,
<video id="preview"></video>
У меня есть код в моем app.component.ts, как показано ниже,
let scanner = new Instascan.Scanner({
video: document.getElementById('preview'),
mirror: false,
facingMode: { exact: 'environment' }});
Instascan.Camera.getCameras().then(cameras => {
if (cameras.length > 0) {
this.scanner.start(cameras[1]);
} else {
alert("Camera Permission denied");
window.location.reload();
}
}).catch(error => {
console.log(error);
window.location.reload();
})
Возникла проблема в Instascan , ошибка выдачи, как показано ниже, пока компиляция, Не удается найти имя 'Instascan' .