New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aiao/lazy-component

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aiao/lazy-component

lazy component for angular

  • 1.6.0
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

@aiao/lazy-component

npm

按需加载 任意 modulecomponent.

此方法适用 angular 8 或是 angular 9 非 ivy 模式中非常有用,ivy 模式可直接使用组件引用

场景

弹框弹出任意组件, 在后台页面操作数据时使用非常频繁,可以隔离模块依赖

ivy 中使用

ivy 中也可以使用这种模式,弹框的内容会按 module 来分割代码延迟加载

需要继承 WithIvyLazyComponent 接口,实现 customElementComponents 属性

import { LazyComponentModule, WithIvyLazyComponent } from '@aiao/lazy-component';
import { NgModule, Type } from '@angular/core';

import { AloneDialogComponent } from './alone-dialog.component';

@NgModule({
  declarations: [AloneDialogComponent],
  imports: [LazyComponentModule]
})
export class AloneDialogModule implements WithIvyLazyComponent {
  customElementComponents: Type<any>[] = [AloneDialogComponent];
}

安装

Angular 8

yarn add @aiao/lazy-component@1.4

Angular 9 非 ivy

yarn add @aiao/lazy-component

使用

参考 dev-lazy-component

Keywords

FAQs

Package last updated on 09 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc