showing results for - "angular window object"
Selena
08 Feb 2018
1import { Inject } from '@angular/core';
2import { DOCUMENT } from '@angular/common';
3
4export class MyClass {
5
6  constructor(@Inject(DOCUMENT) private document: Document) {
7     this.window = this.document.defaultView;
8  }
9
10  check() {
11    console.log(this.document);
12    console.log(this.window);
13  }
14
15}
Sara
01 Aug 2017
1// in app.module.ts
2providers: [
3{ provide: Window, useValue: window }
4]
5
6// in component: 
7Then you can just inject it directly anywhere you want - e.g. in a service:
8
9constructor(private window: Window) {
10// ...
queries leading to this page
angular window open 24window in angularjsget window variable angularangular make window availableangular window objectview global angularr properties in windoowimport the window objectwindowref angular 8app module ts how to use window objectangular using windowaccess window angularangular use window objectcan we use windowobject in angular for globalaccess window object in angularin window variable in angular there is stockfishaccess window from ref currentwindow functions in angularhow to use window angularcan i use window object in angularjsangular window poperty scopedangular object attached to window objectnangular make window availableangular dart get window varangular in window globalwinref angularangular view in window objectimport window objectaccess global window object angularaccess window object angularaccess window object in angular 8angular using window objectwindow object in js angularangular access window objecthow to get event from child chrome window in angula angular 7angular 24windowangular inject browser windowwindow get 28 29 in angularuse window on angularangular alternative to window objectfrom window object to angular componentangular get windowangular don 27t use windowangular 10 window objectwindow method angularwhat properties of angular access it in window objectacess window object in angularangular 8 window objectwindow property get angularangular inject window objectwindowref angularwindow in angularangular dom windowwindow object in angularangular windownangular access window from componentget window reference angularangular windowangulat windowaccess window object in angularjsangular access to window objecthow to use window object in angularhow to get window object in angular angular use windowangular access it in window objectwindow variable angularcheck for window object in angularhow to get the complete window document in angularuse window object in angularhow to use window in angular 8 24window angularjs 24window in angular 8angularjs window service typescripthow to make window in angularhow to use the window in angular 7how to handel window object in angularangular window cariableimport window in angularangular access windowaccessing window object angularwindow in angular 8angular provide 3a windowwindow variable angular 6window angularwhy is this pointing to window in angular componentangular inject windowuse window in angularuse window into componantangular window object