title: $cordovaOauth Error in Ionic Cordova mobile app
body: <p>I am making Google login in my Ionic + Cordova mobile application.
  my app.js</p>
  
  <pre><code>var app = angular.module('starter', ['ionic', 'starter.controllers','starter.services','ngSanitize',  'ngCordova', 'ngCordovaOauth', 'facebook'])
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>.controller('login',['$scope','myService','$location','$state','$timeout',function($scope,myService,$location,$state,$timeout, $http, $cordovaOauth)
  {
  
   $scope.googleLogin = function(){
    $cordovaOauth.google("640286280543-pgr2pqnk0clc7qmobsvgkuno2fin7opd.apps.googleusercontent.com", ["email","profile"]).then(function(result) {
  
    $scope.showProfile = false;
    $http.get("https://www.googleapis.com/plus/v1/people/me", {params: {access_token: result.access_token }})
    .then(function(res) {
  $scope.showProfile = true;
     $scope.details = res.data;
  console.log(res.data)
  }, function(error) {
        alert("Error: " + error);
    });
    },function(error) {
      // error
      $scope.details = 'got error';
  })
  }
  </code></pre>
  
  <p>}])
  <a href="https://www.sitepoint.com/authenticating-users-via-oauth-with-cordova-and-ionic/" rel="nofollow">followed this Tutorial. Click me!</a></p>
  
  <p>My Error:</p>
  
  <blockquote>
    <p>Error: $cordovaOauth is undefined
    $scope.googleLogin@<a href="http://localhost:8100/js/controllers.js:53:3" rel="nofollow">http://localhost:8100/js/controllers.js:53:3</a></p>
  </blockquote>