title: Use Cordova Plugin in Angular 2 + Cordova app
body: <p>I have an Angular 2 app, that I'm building into cordova and deploying to Android/IOS. I'm NOT using ionic, I've seen a number of solutions that use ionic but I can't convert this entire project to ionic now.</p>
  
  <p>So far everything has worked fine, except I can't figure out how to use the cordova plugins.  Specifically I'm trying to use 'cordova-plugin-file' to store local files on the device.</p>
  
  <p>I can't figure out how to import/access plugin files or functions? I may be missing something with how cordova plugins work. Most tutorials show just using whatever the plugin added functionality wise like for example..</p>
  
  <pre><code>window.requestFileSystem(window.TEMPORARY, 5 * 1024 * 1024, function (fs) {
     console.log('file system open: ' + fs.name);
     createFile(fs.root, "newTempFile.txt", false);
  }, onErrorLoadFs);
  </code></pre>
  
  <p>However the above code breaks angular 2 and I get errors like this.</p>
  
  <pre><code> Property 'requestFileSystem' does not exist on type 'Window'.
  </code></pre>
  
  <p>It's pretty obvious that somethings not getting imported or reverenced correctly.  Most likely because cordova is a sub-folder of the angular 2 app. And I run ng build and put the output files into the cordova folder, so at that time it's unaware of cordova?</p>
  
  <pre><code> Angular_2_project
   ├── cordova
   │   └── plugins
   ├── src
   │   └── index.html
   │   └── app
   │        └── html/ts files 
  </code></pre>