-
-
Save WilldelaVega777/9afcbd6cc661f4107c2b74dd6090cebf to your computer and use it in GitHub Desktop.
window-service.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------------------------------------------- | |
// 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; | |
} | |
} |
Thanks mate, works for me!
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
Easier...