title: Adding Facebook login to ionic app
body: <p>I am newbie to a Angular and Ionic as well.</p>
  
  <p>Tried the following tutorial: </p>
  
  <p><a href="https://www.sitepoint.com/how-to-integrate-facebook-login-into-a-cordova-based-app/" rel="nofollow">https://www.sitepoint.com/how-to-integrate-facebook-login-into-a-cordova-based-app/</a></p>
  
  <p>Steps performed: 
  1.In app browser is installed.</p>
  
  <ol start="2">
  <li><p>Included libraries.</p>
  
  <pre><code>&lt;script src="lib/ngCordova/dist/ng-cordova.js"&gt;&lt;/script&gt;
  &lt;script src="lib/ng-cordova-oauth/dist/ng-cordova-oauth.js"&gt;&lt;/script&gt;
  &lt;script src="cordova.js"&gt;&lt;/script&gt;
  </code></pre></li>
  <li><p>Include code inside index.html before body closing tag:</p>
  
  <pre><code>&lt;script&gt;
     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'));
  &lt;/script&gt;
  </code></pre></li>
  <li><p>Following is my login.html : </p>
  
  <pre><code> &lt;button class="btn-margin-left button button-positive" ng-click="menuCtrl.fbLogin()"&gt;
    &lt;i class="ion-social-facebook icon-size1 "&gt;&lt;/i&gt;
   &lt;/button&gt;
  </code></pre></li>
  <li><p>This is my controller : </p>
  
  <pre><code>menuCtrl.fbLogin = function ($cordovaOauth,$http) {
      facebookLogin(window.cordovaOauth, window.http);
  }
  </code></pre></li>
  <li><p>This is my app.js : </p>
  
  <pre><code>angular.module("cgsi",['ionic', 'ngCordova','ngCordovaOauth'])
    .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $httpProvider, $logProvider, $sceDelegateProvider,$cordovaOauth,$http) {
    window.cordovaOauth = $cordovaOauth;
    window.http = $http;
   });
  </code></pre></li>
  </ol>
  
  <p>I am getting error <strong>Unknown provider $cordovaOauth</strong>
  Please let me know where i am going wrong?</p>