@@ -24,45 +24,31 @@ by [@tomastrajan](https://twitter.com/tomastrajan)
2424## Quickstart
2525
26261 . Install ` npm i @angular-extensions/elements `
27- 2 . Add ` import { LazyElementsModule } from '@angular-extensions/elements'; `
28- 3 . Append ` LazyElementsModule ` to the ` imports: [] ` of your ` AppModule `
29- 4 . Add new ` schemas: [] ` property with ` CUSTOM_ELEMENTS_SCHEMA ` value to ` @NgModule ` decorator of your ` AppModule `
27+ 2 . Add ` import { LazyElementDirective } from '@angular-extensions/elements' ` ;
28+ 3 . Append ` LazyElementDirective ` to the ` imports: [] ` of your ` MyOrgComponent `
29+ 4 . Add new ` schemas: [] ` property with ` CUSTOM_ELEMENTS_SCHEMA ` value to ` @Component ` decorator of your ` MyOrgComponent `
30305 . Use ` *axLazyElement ` directive on an element you wish to load and pass in the url of the element bundle
3131
32- Example of module implementation...
33-
34- ``` typescript
35- import { NgModule , CUSTOM_ELEMENTS_SCHEMA } from ' @angular/core' ;
36- import { BrowserModule } from ' @angular/platform-browser' ;
37- import { LazyElementsModule } from ' @angular-extensions/elements' ;
38-
39- @NgModule ({
40- schemas: [CUSTOM_ELEMENTS_SCHEMA ],
41- imports: [BrowserModule , LazyElementsModule ],
42- declarations: [AppComponent , FeatureComponent ],
43- bootstrap: [AppComponent ],
44- })
45- export class AppModule {}
46- ```
47-
4832Example of component implementation
4933
5034``` typescript
51- import { Component } from ' @angular/core' ;
35+ import { Component , CUSTOM_ELEMENTS_SCHEMA } from ' @angular/core' ;
36+ import { LazyElementDirective } from ' @angular-extensions/elements' ;
5237
5338@Component ({
5439 selector: ' your-org-feature' ,
40+ imports: [LazyElementDirective ],
41+ schemas: [CUSTOM_ELEMENTS_SCHEMA ],
5542 template: `
5643 <!-- will be lazy loaded and uses standard Angular template bindings -->
5744 <some-element
5845 *axLazyElement="elementUrl"
5946 [data]="data"
6047 (dataChange)="handleChange($event)"
61- >
62- </some-element>
48+ ></some-element>
6349 ` ,
6450})
65- export class FeatureComponent {
51+ export class MyOrgComponent {
6652 elementUrl = ' https://your-org.com/elements/some-element.js' ;
6753
6854 data: SomeData ;
0 commit comments