File

src/app/directives/clipboard/window-token.ts

import { NgModule } from '@angular/core';
import { InjectionToken } from '@angular/core';

export const WINDOW = new InjectionToken<Window>('WindowToken');

export function _window(): Window {
  return window;
}

@NgModule({
  providers: [
    {
      provide: WINDOW,
      useFactory: _window
    }
  ]
})
export class WindowTokenModule {}

results matching ""

    No results matching ""