2
我想通過網絡攝像頭簡單地閱讀qr代碼,但我在控制檯打開時出現此錯誤角的幫助頁面,但說用ngRoute
Error: [$injector:modulerr] http://errors.angularjs.org/1.4.7/$injector/modulerr?p0=q...)
這裏的角和HTML代碼
<html ng-app="App">
<body ng-controller="qrCrtl">
<qr-scanner width="400" height="300" ng-success="onSuccess(data)" ng-error="onError(error)" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-resource.min.js"></script>
<script data-main="qr-scanner.js" src="require.js"></script>
<script src="src/jsqrcode-combined.min.js"></script>
<script>
var App = angular.module('App', ['qrScanner']);
App.controller('qrCrtl', ['$scope', function($scope) {
$scope.onSuccess = function(data) {
console.log(data);
};
$scope.onError = function(error) {
console.log(error);
};
$scope.onVideoError = function(error) {
console.log(error);
};
}]);
</script>
</body>
</html>
如果添加完整的錯誤,而不是截短一個這將有助於。 –
您可能在檢索'qr-scanner.js'腳本時遇到問題。此外,[Angular-qr-scanner](http://sembrestels.github.io/angular-qr-scanner/)有問題的庫?一些更多的細節將有所幫助 – scniro
我使用git repo –