title: How can I use a window object in Angular 2?
body: <p>I tried to put the following code to get a window object in angular 2:</p>
  <pre class="lang-js prettyprint-override"><code>      @Component({
            selector: 'app-slider',
            templateUrl: './slider.component.html',
            styleUrls: ['./slider.component.css'],
            providers: [
              SliderService, 
              { provide: &quot;windowObject&quot;, useValue: window}
            ]
          })
          export class SliderComponent implements OnInit {
          
            sliderList: Slider[] = [];
          
            constructor( private _sliderservice:SliderService, @Inject(&quot;windowObject&quot;) private _window:window ) { }
  </code></pre>
  <p>Unfortunately it does not work.</p>