title: ionic 2 window object doesn't transpile, issue with WebSql window.openDatabase(..)
body: <p>I am having trouble to use the <code>window</code> object in Ionic2.</p>
  
  <p>This question follows the same idea as described in <a href="https://stackoverflow.com/questions/40301003/ionic2-check-if-running-as-ionic-serve-to-use-a-conditionnal-in-the-program">my previous question</a>.</p>
  
  <p>I found a quite useful input about <code>window</code> object <a href="https://stackoverflow.com/questions/38767595/accessing-window-object-in-ionic-2-angular-2-beta-10">there</a>. Nevertheless I do have a problem.</p>
  
  <p><strong>Based on the conditional of the platform I want to use cordova-plugin-sqlite if it runs on a real device, and if it runs on a browser (Chrome), I want to use WebSql.</strong></p>
  
  <p>I use a service to get the DB connection, in the class regarding that service I've created a function to set the DB value of my service based on conditionnal of the platform kind (and this function is called in [my project]\src\app.components.ts):</p>
  
  <pre><code>getDummyDbForBrowerDev(platform){
      console.log('SqlSettingsService() getDummyDbForBrowerDev starts');
      if(platform.is('core')){
          console.info(window);
          this.db = window.openDatabase("ionic2BrowserDev","1.0","",5*1024*1024);
      }   
  }
  </code></pre>
  
  <p>As it is the function does not transpile, I get an error when "Ionic serve" is running saying that:</p>
  
  <blockquote>
    <p>Property "openDatabase" does not exist on type "window"</p>
  </blockquote>
  
  <p>What I really don't get is that: If I comment: <code>//      this.db = window.openDatabase("ionic2BrowserDev","1.0","",5*1024*1024);</code></p>
  
  <p>Then it transpiles fine. And in my brower the <code>console.info(window)</code> displays a list of all properties underneath the <code>window</code> object, and I can see that it includes <code>openDatabase</code>.</p>
  
  <p>So I am really confuse why it cannot transpile.</p>
  
  <p>Has anyone a clue of what I am doing wrong?</p>