@aiao/lazy-module
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@aiao/lazy-module

npm

按需加载 angular module

场景

不用等到路由触发后才加载相应模块,可以由代码控制主动预加载,提高用户体验

安装

yarn add @aiao/lazy-module

版本

lazy-module angular
2.x 16.x
1.x 9 - 15.x

使用

参考 dev-lazy-module

export class AppComponent {
  constructor(private lazyModuleLoader: LazyModuleLoader) {}
  async preload() {
    await this.lazyModuleLoader.load('testModule');
    console.log('preload');
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @aiao/lazy-module

Weekly Downloads

2

Version

2.0.0

License

none

Unpacked Size

28.9 kB

Total Files

17

Last publish

Collaborators

  • aiao