Angular package nu-lazy lazy load resources allow you to load lazy web resources in Angular 7+ projects.
angular lazy load component, angular lazy load module, lazy loading in angular stackblitz, lazy loading in angular example, lazy loading images angular stackblitz
A Modern Lazy Loading Library For Images | Layzr.js
How to make use of it:
Install
# NPM $ npm install nu-lazy --save
Usage
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); }
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, including .js , .css |
loadScript(path: string) | Promise<LazyResult> | Load a script resources |
loadStyle(path: string) | Promise<LazyResult> | Load a style resources |
Lazy Load Resources for Angular, nu-lazy Plugin/Github
See Demo And Download
Official Website(ng-util): Click Here
This superior jQuery/javascript plugin is developed by ng-util. For extra advanced usage, please go to the official website.