MCPcopy Index your code
hub / github.com/angular-extensions/elements

github.com/angular-extensions/elements @v20.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v20.0.2 ↗ · + Follow
168 symbols 302 edges 76 files 0 documented · 0% updated 13mo ago★ 32023 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ANGULAR EXTENSIONS ELEMENTS

The easiest way to lazy-load Angular Elements or any other web components in your Angular application!

by @tomastrajan

npm npm npm Build Status codecov Conventional Commits Twitter Follow

Documentation

Quickstart

  1. Install npm i @angular-extensions/elements
  2. Add import { LazyElementDirective } from '@angular-extensions/elements';
  3. Append LazyElementDirective to the imports: [] of your MyOrgComponent
  4. Add new schemas: [] property with CUSTOM_ELEMENTS_SCHEMA value to @Component decorator of your MyOrgComponent
  5. Use *axLazyElement directive 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: `

    <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, axLazyElement works but axLazyElementDynamic does NOT work with IVY)
  • 7.x
  • 6.x (eg npm i @angular-extensions/elements@^6.0.0)

Internal dep graph

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! 🤗

Tomas Trajan Tomas Trajan 💻 🎨 💡 📖 🤔 🚇 ⚠️ Artur Androsovych Artur Androsovych 💻 🐛 Wayne Maurer Wayne Maurer 🐛 💻 Santosh Yadav Santosh Yadav 💻 📦 David Dal Busco David Dal Busco 💻 💡 Zama Khan Mohammed Zama Khan Mohammed 💻 🤔 ⚠️
Angel Fraga Parodi Angel Fraga Parodi 💡 🤔 ye3i ye3i 💻 🤔 Heorhi Shakanau Heorhi Shakanau 💻 🤔 Felipe Plets Felipe Plets 💻 🎨 💡 📖 🤔 ⚠️ jkubiszewski jkubiszewski 💻 Heorhi Shakanau Heorhi Shakanau 💻
NagornovAlex NagornovAlex 💻 Joseph Davis Joseph Davis 💻 Arooba Shahoor Arooba Shahoor 💻 Maximilian Wright Maximilian Wright 📖 Jakub Stawiarski Jakub Stawiarski 💻 Paweł Kubiak Paweł Kubiak 💻
Egor Volvachev Egor Volvachev 💻 Daniel Bou Daniel Bou 💻

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!

Omniboard.dev - getting started in less than 5 minutes

Extension points exported contracts — how you extend this code

TrustedTypePolicy (Interface)
(no doc)
projects/elements/src/lib/lazy-elements/trusted-types.ts
TrustedTypePolicyFactory (Interface)
(no doc)
projects/elements/src/lib/lazy-elements/trusted-types.ts
HooksConfig (Interface)
(no doc)
projects/elements/src/lib/lazy-elements/lazy-elements.interface.ts
ElementConfig (Interface)
(no doc)
projects/elements/src/lib/lazy-elements/lazy-elements.interface.ts
LazyElementsRegistry (Interface)
(no doc)
projects/elements/src/lib/lazy-elements/lazy-elements.interface.ts

Core symbols most depended-on inside this repo

loadElement
called by 25
projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts
forRoot
called by 5
projects/elements/src/lib/lazy-elements/lazy-elements.module.ts
getElementConfig
called by 4
projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts
provideAxLazyElements
called by 3
projects/elements/src/lib/lazy-elements/lazy-elements.providers.ts
provideAxLazyElementsConfigs
called by 3
projects/elements/src/lib/lazy-elements/lazy-elements.providers.ts
addConfigs
called by 3
projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts
#stripUrlProtocol
called by 3
projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts
preload
called by 2
projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts

Shape

Class 88
Method 60
Function 10
Interface 10

Languages

TypeScript100%

Modules by API surface

projects/elements/src/lib/lazy-elements/lazy-elements-loader.service.ts16 symbols
projects/elements/src/lib/lazy-elements/lazy-element/lazy-element.directive.spec.ts9 symbols
projects/elements/src/lib/lazy-elements/lazy-elements.interface.ts7 symbols
projects/elements-demo/src/app/features/examples/advanced/advanced.component.ts7 symbols
projects/elements/src/lib/lazy-elements/lazy-elements.module.ts6 symbols
projects/elements-demo/src/app/features/examples/dynamic/dynamic.component.ts6 symbols
projects/elements-demo/src/app/app.component.ts6 symbols
projects/elements/src/lib/lazy-elements/trusted-types.ts5 symbols
projects/elements/src/lib/lazy-elements/lazy-element/lazy-element.directive.ts5 symbols
projects/elements-demo/src/app/features/examples/basic/basic.component.ts5 symbols
projects/elements/src/lib/lazy-elements/lazy-elements.providers.spec.ts4 symbols
projects/elements/src/lib/lazy-elements/lazy-elements.module.spec.ts4 symbols

For agents

$ claude mcp add elements \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact