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 –