# nu-lazy

> Lazy load resources for Angular

Latest version **7.0.0** (published 2018-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install nu-lazy
pnpm add nu-lazy
yarn add nu-lazy
bun add nu-lazy
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2018-12-14 |
| First published | 2018-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 84.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | cipchk |
| Maintainers | cipchk |
| Keywords | angular, angular-lazy, angular-component, lazy, ui component, component |

## Links

- npm: https://www.npmjs.com/package/nu-lazy
- Repository: https://github.com/ng-util/lazy
- Homepage: https://github.com/ng-util/lazy#readme
- Issues: https://github.com/ng-util/lazy/issues
- npm.io page: https://npm.io/package/nu-lazy

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@progress/kendo-vue-listbox](https://npm.io/package/@progress/kendo-vue-listbox.md) — 932 weekly downloads

## Recent versions

- 7.0.0 (latest) — 2018-12-14
- 0.0.1 — 2018-12-14

## README

# nu-lazy
---

Lazy load resources for Angular

[![NPM version](https://img.shields.io/npm/v/nu-lazy.svg?style=flat-square)](https://www.npmjs.com/package/nu-lazy)
[![Build Status](https://img.shields.io/travis/ng-util/lazy/master.svg?style=flat-square)](https://travis-ci.org/ng-util/lazy)
[![Codecov](https://img.shields.io/codecov/c/github/ng-util/lazy.svg?style=flat-square)](https://codecov.io/gh/ng-util/lazy)

## Demo

- [Live Demo](https://cipchk.github.io/nu-lazy/)
- [Stackblitz](https://stackblitz.com/edit/nu-lazy)

## Install

[![nu-lazy](https://nodei.co/npm/nu-lazy.png)](https://npmjs.org/package/nu-lazy)

## Usage

```typescript
import { LazyService } from 'nu-lazy';

export class AppComponent {
  constructor(private srv: LazyService) { }

  async loadBS() {
    const res = await this.srv.load(`https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css`);
    console.log(`bootstrap`, res);
  }
```

## How to use it with:

+ `Stackblitz` sample available [here](https://stackblitz.com/edit/nu-lazy).

## API

| name | type | description |
| ---- | -- | ----------- |
| `events` | `Observable<LazyResult[]>` | Events change callback |
| `clear()` | `void` | Clean all cached items |
| `load(paths: string | string[])` | `Promise<LazyResult[]>` | Load the specified resources, includes `.js`, `.css` |
| `loadScript(path: string, innerContent?: string)` | `Promise<LazyResult>` | Load a script resources |
| `loadStyle(path: string, rel: string = 'stylesheet', innerContent?: string)` | `Promise<LazyResult>` | Load a style resources |

## License

nu-lazy is released under the MIT license.

---
_Source: https://npm.io/package/nu-lazy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
