title: Accessing window object in Ionic 2 / Angular 2 beta 10
body: <p>In Angular 1.x and Ionic 1.x I could access the window object through dependency injection, like so:</p>
  
  <pre><code>angular.module('app.utils', [])
  
  .factory('LocalStorage', ['$window', function($window) {
      return {
          set: function(key, value) {
            $window.localStorage[key] = value;
          },
          get: function(key, defaultValue) {
            return $window.localStorage[key] || defaultValue;
          }
      };
  }]);
  </code></pre>
  
  <p>How can I do the same in Angular 2 &amp; Ionic 2?</p>