Thiqah Lit-Element Header Component POC
Thiqah Lit-Element Header Component POC is the beta version of lit-element web components development developed by Thiqah Frontend Development Team
Installation
in case using NPM package installer run one of the following commnad lines
npm i header-test-c -Dnpm install header-test-c --save-dev
in case using YARN package installer
yarn add header-test-c
Usage in regular web project
static pages, .NET or any none JS framework inside your html file
<!-- add vendor custom element adapters and styles before the body tag be sure that file comes from ./node-module/header-test-c/vendor/custom-elements-es5-adapter.js ./node-module/header-test-c/src/header.min.css --> <!-- add web components loader and header component source be sure that file comes from /node-module/header-test-c/vendor/webcomponents-loader.js /node-module/header-test-c/header.min.js --> <!-- to listen to language changes please add the current listener -->
Usage in Angular Project
// inside app.module.ts allow CUSTOM_ELEMENTS_SCHEMA;
<!-- inside index.html add vendors and assets from node-modules --><!-- add vendor custom element adapters before the body tag be sure that file comes from /node-module/header-test-c/vendor/custom-elements-es5-adapter.js /node-module/header-test-c/vendor/webcomponents-loader.js /node-module/header-test-c/header.min.js-->
Or import assets inside angular.json
// inside your app.component.ts add your event listener;; /** * MainMenu.model should contain the current models interface Menu { name: string; link: string; counter?: number; }; export interface MainMenu { ar: Menu[]; en: Menu[]; }*/
<!-- inside app.component.html render menu and current language -->
Contributing
License
THIQAH Frontend Team KSA