Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@WilldelaVega777 WilldelaVega777 commented Apr 27, 2016

Easier...

@stewhouston

This comment has been minimized.

Copy link

@stewhouston stewhouston commented May 17, 2016

Thanks mate, works for me!

@Ks89

This comment has been minimized.

Copy link

@Ks89 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
You can’t perform that action at this time.