title: Ionic 2 File Plugin usage examples
body: <p>Does anyone have complete examples about how to use the Cordova Native File Plugin in a Ionic 2/Angular 2 project?</p>
  
  <p>I installed this plugin but the documentation don't seems to make much sense to me due the fact it is fragmented and lacks of a complete example, including all needed imports.</p>
  
  <p>For example, the following example don't shows where objects like LocalFileSystem or window came from.</p>
  
  <pre><code>window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
  
      console.log('file system open: ' + fs.name);
      fs.root.getFile("newPersistentFile.txt", { create: true, exclusive: false }, function (fileEntry) {
  
          console.log("fileEntry is file?" + fileEntry.isFile.toString());
          // fileEntry.name == 'someFile.txt'
          // fileEntry.fullPath == '/someFile.txt'
          writeFile(fileEntry, null);
  
      }, onErrorCreateFile);
  
  }, onErrorLoadFs);
  </code></pre>
  
  <p>For example, I need to crate a property file. First I need to check if a file exists on app sandbox storage area, if don't exists I must create it. Then I must open the file write data and save it . How could I do that?</p>