title: cordova not defined even on device
body: <p>I am trying to get a custom plugin work but even without this custom plugin, when I try to use cordova.plugins, it throws this error in the browser, emulator, and real device.</p>
  
  <p><a href="https://i.stack.imgur.com/WPB8T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WPB8T.png" alt="enter image description here"></a>
  Here's the code home.ts</p>
  
  <pre><code>import {Component} from '@angular/core';
  import {NavController, Platform} from 'ionic-angular';
  declare var cordova:any;
  @Component({
      selector: 'page-home',
      templateUrl: 'home.html'
  })
  
  export class HomePage {
      constructor(public navCtrl: NavController, public platform: Platform) {
          platform.ready().then(() =&gt; {this.test();});
      }
      test() {
          console.log('platform is ready..');alert(typeof cordova);
      }
  }
  </code></pre>
  
  <p>IONIC INFO:</p>
  
  <p>cli packages: (/usr/local/lib/node_modules)</p>
  
  <pre><code>@ionic/cli-utils  : 1.19.1
  ionic (Ionic CLI) : 3.19.1
  </code></pre>
  
  <p>global packages:</p>
  
  <pre><code>cordova (Cordova CLI) : 8.0.0 
  </code></pre>
  
  <p>local packages:</p>
  
  <pre><code>@ionic/app-scripts : 3.1.8
  Cordova Platforms  : android 7.0.0 browser 5.0.3
  Ionic Framework    : ionic-angular 3.9.2
  </code></pre>
  
  <p>System:</p>
  
  <pre><code>Node  : v8.9.4
  npm   : 5.6.0 
  OS    : macOS High Sierra
  Xcode : Xcode 9.2 Build version 9C40b 
  </code></pre>
  
  <p>Environment Variables:</p>
  
  <pre><code>ANDROID_HOME : /usr/local/share/android-sdk
  </code></pre>
  
  <p>Misc:</p>
  
  <pre><code>backend : legacy
  </code></pre>