From 1f253f9275631cdfe4785c5abc5a50f5a53571af Mon Sep 17 00:00:00 2001 From: Florent Gravin Date: Tue, 28 May 2024 09:13:39 +0200 Subject: [PATCH] doc(wc): improve add a new web component section --- apps/webcomponents/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/webcomponents/README.md b/apps/webcomponents/README.md index d842da3b72..215d6a5d1d 100644 --- a/apps/webcomponents/README.md +++ b/apps/webcomponents/README.md @@ -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