ngx-dom-wrappers
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

ngx-dom-wrappers

npm npm Build Status devDependencies

Prerequisites

  • Node
  • npm or yarn.

About

Angular library providing wrappers for dom types.

Table of Contents

Installation

npm install ngx-dom-wrappers

or

yarn add ngx-dom-wrappers

Usage

  1. Import DomWrappersModule in AppModule or CoreModule of your application.

AppModule

 
@NgModule({
  imports: [
    // Other imports
    DomWrappersModule
    // Other imports
  ],
})
export class AppModule { }
 

CoreModule

 
@NgModule({
  imports: [
    // Other imports
    DomWrappersModule
    // Other imports
  ],
  exports: [
    // Other exports
    DomWrappersModule
    // Other exports
  ],
})
export class CoreModule { }
 
  1. Use wrappers in your code
 
import { WINDOW, LOCAL_STORAGE, SESSION_STORAGE } from 'ngx-dom-wrappers'
 
constructor(
    @Inject(WINDOW) windowWrapperany,
    @Inject(LOCAL_STORAGE) localStorageWrapperany,
    @Inject(SESSION_STORAGE) sessionStorageWrapperany,
  ) {
    const windowObject = windowWrapper as Window
    if (windowObject) {
    // Your code
  }
}
 

Resources

License

MIT

Package Sidebar

Install

npm i ngx-dom-wrappers

Weekly Downloads

4

Version

0.0.5

License

MIT

Unpacked Size

52.2 kB

Total Files

31

Last publish

Collaborators

  • spaier