Created
April 14, 2017 07:49
-
-
Save jaynzr/a86d92f3ad821bc895c02566f83aa669 to your computer and use it in GitHub Desktop.
angular service to provide window object http://stackoverflow.com/a/37176929
This file contains 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
import { Injectable } from '@angular/core'; | |
function getWindow (): any { | |
return window; | |
} | |
@Injectable() | |
export class WindowService { | |
get nativeWindow (): any { | |
return getWindow(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment