An Angular service to provide window and document objects
Assuming you want a SOLID code and keep the single responsibility principle, you would need to inject window and document separately.
A clean way is to provide each of them using the useValue property of your provider:

@NgModule({
  declarations: [...],
  imports: [...],
  providers: [
   { provide: "windowObject", useValue: window}
  ]
})


as already answered on SO:
same stuff for the document provider.