I am newbie to a Angular and Ionic as well.
Tried the following tutorial:
https://www.sitepoint.com/how-to-integrate-facebook-login-into-a-cordova-based-app/
Steps performed: 1.In app browser is installed.
Included libraries.
<script src="lib/ngCordova/dist/ng-cordova.js"></script> <script src="lib/ng-cordova-oauth/dist/ng-cordova-oauth.js"></script> <script src="cordova.js"></script>
Include code inside index.html before body closing tag:
<script> window.fbAsyncInit = function() { FB.init({ appId : 'MyappID', xfbml : true, version : 'v2.6' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script>
Following is my login.html :
<button class="btn-margin-left button button-positive" ng-click="menuCtrl.fbLogin()"> <i class="ion-social-facebook icon-size1 "></i> </button>
This is my controller :
menuCtrl.fbLogin = function ($cordovaOauth,$http) { facebookLogin(window.cordovaOauth, window.http); }
This is my app.js :
angular.module("cgsi",['ionic', 'ngCordova','ngCordovaOauth']) .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $httpProvider, $logProvider, $sceDelegateProvider,$cordovaOauth,$http) { window.cordovaOauth = $cordovaOauth; window.http = $http; });
I am getting error Unknown provider $cordovaOauth Please let me know where i am going wrong?