Skip to content

Instantly share code, notes, and snippets.

@WilldelaVega777
Forked from lokanx/window-service.ts
Last active August 23, 2016 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WilldelaVega777/9afcbd6cc661f4107c2b74dd6090cebf to your computer and use it in GitHub Desktop.
Save WilldelaVega777/9afcbd6cc661f4107c2b74dd6090cebf to your computer and use it in GitHub Desktop.
window-service.ts
//--------------------------------------------------------------------------------------------------
// Imports Section:
//--------------------------------------------------------------------------------------------------
import {Injectable} from 'angular2/core'
import {window} from 'angular2/src/facade/browser';
//--------------------------------------------------------------------------------------------------
// Service Class:
//--------------------------------------------------------------------------------------------------
@Injectable()
export class WindowService
{
//----------------------------------------------------------------------------------------------
// Constructor Method Section:
//----------------------------------------------------------------------------------------------
constructor(){}
//----------------------------------------------------------------------------------------------
// Public Properties Section:
//----------------------------------------------------------------------------------------------
get nativeWindow() : Window
{
return window;
}
}
@WilldelaVega777
Copy link
Author

WilldelaVega777 commented Apr 27, 2016

Easier...

@stewhouston
Copy link

Thanks mate, works for me!

@Ks89
Copy link

Ks89 commented Aug 23, 2016

Is it working also with Angular2 rc5?
Because I cannot get window from 'angular2/src/facade/browser'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment