Skip to content

Commit

Permalink
doc(wc): improve add a new web component section
Browse files Browse the repository at this point in the history
  • Loading branch information
fgravin committed May 28, 2024
1 parent 2ec9618 commit 1f253f9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/webcomponents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ To export content as a Web Component you have to:
}
```

- Provide the dependencies which are not inject in root by default (eg `SearchFacade`, `SearchService`, etc.)

```typescript
{
providers: [SearchFacade]
}
```

- import gnui styles from the component css file

```css
@import '../../../styles.css';
```

- add your component in application module `webcomponents.module.ts` `declarations` list.
- register your component as a custom element in the `CUSTOM_ELEMENTS` array in application module `webcomponents.ts`, the custom element identifier (i.e Web Component tag name) _must_ be the same as the component folder name

Expand Down

0 comments on commit 1f253f9

Please sign in to comment.