angular-extensions/elements
关于
Lazy load Angular Elements (or any other web components / custom elements ) with ease!
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
ANGULAR EXTENSIONS ELEMENTS
The easiest way to lazy-load Angular Elements or any other web components in your Angular application!
by @tomastrajan
Documentation
Quickstart
- Install
npm i @angular-extensions/elements - Add
import { LazyElementDirective } from '@angular-extensions/elements'; - Append
LazyElementDirectiveto theimports: []of yourMyOrgComponent - Add new
schemas: []property withCUSTOM_ELEMENTS_SCHEMAvalue to@Componentdecorator of yourMyOrgComponent - Use
*axLazyElementdirective on an element you wish to load and pass in the url of the element bundle
Example of component implementation
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { LazyElementDirective } from '@angular-extensions/elements';
@Component({
selector: 'your-org-feature',
imports: [LazyElementDirective],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
template: `
<!-- will be lazy loaded and uses standard Angular template bindings -->
<some-element
*axLazyElement="elementUrl"
[data]="data"
(dataChange)="handleChange($event)"
></some-element>
`,
})
export class MyOrgComponent {
elementUrl = 'https://your-org.com/elements/some-element.js';
data: SomeData;
handleChange(change: Partial<SomeData>) {
// ...
}
}
Supported Angular versions
Library was tested with the following versions of Angular and is meant to be used
with the corresponding major version ("@angular/core"": "^15.0.0" with "@angular-extensions/elements": "^15.0.0" ).
- 9.x (full IVY support, using renderers so careful with SSR)
- 8.x (partial IVY support,
axLazyElementworks butaxLazyElementDynamicdoes NOT work with IVY) - 7.x
- 6.x (eg
npm i @angular-extensions/elements@^6.0.0)
Internal dep graph

Become a contributor
Missing a feature, found bug or typo in docs?
Please, feel free to open an issue or submit a pull request to make this project better for everyone! 🤗
Sponsors
Are you currently working in an enterprise polyrepo environment with many applications and found yourself thinking you could provide so much more value only if you had better overview to plan, track progress and just get things done?
Try Omniboard, the best tool for lead software engineers and architects that helps them to get an overview to drive change in enterprise polyrepo environments by querying and tracking all their code bases!
The free plan let's you get a full overview of all your projects with your first dashboard, tracking up to 3 different things!
探索相关项目
加载中…