Skip to content

Commit 84562d5

Browse files
committed
feat(docs): improve docs, modernize readme quickstart
1 parent 85a9a53 commit 84562d5

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

README.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,45 +24,31 @@ by [@tomastrajan](https://twitter.com/tomastrajan)
2424
## Quickstart
2525

2626
1. 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`
3030
5. 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-
4832
Example 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;

projects/elements-demo/src/app/features/home/home.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ export class HomeComponent implements OnInit {
3838
}
3939

4040
const CODE_EXAMPLE_COMPONENT = `@Component({
41-
standalone: true,
42-
selector: 'your-org-feature',
43-
imports: [LazyElementDirective]
41+
selector: 'my-org-component',
42+
imports: [LazyElementDirective],
4443
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4544
template: \`
4645
<!-- will be lazy loaded and uses standard Angular template bindings -->

0 commit comments

Comments
 (0)