This project was generated with Angular CLI version 9.
It is the same way how angular handle document. With this module, you can use WINDOW token just like DOCUMENT token.
BREAKING CHANGE: Support Angular >= 15 only
BREAKING CHANGE: Support Angular >= 13 only
return undefine if window is undefine. Before, it doesn't even inject WindowToken.
removed now-unnecessary NgxWindowTokenModule
, it will be inject into root module
change WindowTokenModule
-> NgxWindowTokenModule
- Angular >=6.0.0
You can get it on npm.
npm install ngx-window-token --save
1. npm i
2. npm run build
If you use SystemJS to load your files, you might have to update your config:
System.config({
map: {
'ngx-window-token': 'node_modules/ngx-window-token'
}
});
In your component
constructor(@Inject(WINDOW) _window) { }
For webpack / Angular CLI, it works as any other libraries. Please check demo folder for more help.
or clone this repo and run ng serve
- Your commits conform to the conventions established here