Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.17 KB

File metadata and controls

52 lines (38 loc) · 1.17 KB

@acpaas-ui/ngx-utils

The WindowModule contains a window provider service to inject the browser’s native window object into a component. It's actually based on Brian Love's Angular Window Provider, so you can find more information in the article he wrote about it.

Usage

import { WindowModule } from '@acpaas-ui/ngx-utils';

Documentation

Visit our documentation site for full how-to docs and guidelines

Example

import { WindowModule, WINDOW_PROVIDERS } from '@acpaas-ui/ngx-utils';

@NgModule({
    imports: [
        WindowModule
    ],
    providers: [WINDOW_PROVIDERS],
});

export class AppModule {};
import { WINDOW } from '@acpaas-ui/ngx-utils';
constructor(
    @Inject(WINDOW) public window
) {}
<dl>
    <dt>Height:</dt>
        <dd><pre>{{ window.innerHeight }}</pre></dd>
    <dt>Width:</dt>
        <dd><pre>{{ window.innerWidth }}</pre></dd>
</dl>

Contributing

Visit our Contribution Guidelines for more information on how to contribute.