我有这个HTML
<div data-ng-app="myApp">
<div ng-controller="OAuthCtrl">
<label >
<button class="button button-block button-positive"
ng-click="facebookLogin()">
Login with Facebook
</button>
</label>
</div>
</div>
和这个javascript
<script type="text/javascript" src="js/framework7.js"></script>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/angular/angular.min.js"></script>
<script type="text/javascript" src="js/ngCordova/dist/ng-cordova.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script>
var app = angular.module('myApp', ['ngCordova']);
app.controller("OAuthCtrl", function($scope, $cordovaOauth){
$scope.facebookLogin = function() {
//user your fb app Id..
$cordovaOauth.facebook(fb_appId,
["email"]).then(function(result) {
alert(result.access_token);
// results
}, function(error) {
alert("error");
alert(error);
// error
});
}
});
</script>
当我在chrome上运行代码时出现此错误
错误:[$ injector:unpr] http://errors.angularjs.org/1.6.5/ $ injector / unpr?p0 =%24cordovaOauthProvider%20%3C-%20%24cordovaOauth%20%3C-%20OAuthCtrl
导致此链接
https://docs.angularjs.org/error/ $注射器/ unpr?P0 = $ cordovaOauthProvider%20%3 C-%20 $ cordovaOauth%20%3 C-%20OAuthCtrl
我正在关注这个教程,以便能够使用他或她自己的Facebook帐户https://www.codeproject.com/Tips/1031475/How-to-Integrate-Facebook-Login-into-a-Cordova-App登录 我哪里错了?。