{"id":15324466,"url":"https://github.com/shadowhijackers/simple-angular-custom-element","last_synced_at":"2025-04-15T02:52:14.613Z","repository":{"id":35786747,"uuid":"200501436","full_name":"shadowhijackers/simple-angular-custom-element","owner":"shadowhijackers","description":"show casing the custom element creation in angular","archived":false,"fork":false,"pushed_at":"2023-01-07T08:24:26.000Z","size":2724,"stargazers_count":3,"open_issues_count":22,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T02:52:05.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shadowhijackers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-04T14:16:32.000Z","updated_at":"2022-06-17T14:16:12.000Z","dependencies_parsed_at":"2023-01-16T06:27:42.027Z","dependency_job_id":null,"html_url":"https://github.com/shadowhijackers/simple-angular-custom-element","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowhijackers%2Fsimple-angular-custom-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowhijackers%2Fsimple-angular-custom-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowhijackers%2Fsimple-angular-custom-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowhijackers%2Fsimple-angular-custom-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadowhijackers","download_url":"https://codeload.github.com/shadowhijackers/simple-angular-custom-element/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997086,"owners_count":21195797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T09:26:54.993Z","updated_at":"2025-04-15T02:52:14.595Z","avatar_url":"https://github.com/shadowhijackers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular Custom Element\n    \n    1. Create an angular application without routing \n        Ex: ng new simple-angular-custome-element\n    2. Go to the project \n        Ex: cd simple-angular-custome-element/\n    3. Add the angular elements\n        Ex: ng add @angular/elements\n    4. Add the component \n        Ex: ng g component header\n    5. Change the TS target version into ES2015\n        EX: \"target\": \"es2015\",                \n    6. Empty the Appcomponent of Bootstrap array in app module\n        EX: bootstrap: []\n    7. Create an Element by following\n        ngDoBootstrap() {\n            const headerElement = createCustomElement(HeaderComponent, {injector: this.injector});\n            customElements.define('app-header', headerElement);\n         }  \n    8. Take the build\n        EX: ng build --prod --output-hashing=none\n    9. Merge the ./dist/simple-angular-custome-element/runtime.js \n                 ./dist/simple-angular-custome-element/polyfills.js \n                 ./dist/simple-angular-custome-element/scripts.js \n                 ./dist/simple-angular-custome-element/main.js   \n                       to \n                       \n                  destination file\n                  \n                  ./custome-elments/app-header.js       \n                             \n    10. now call the element\n       Ex: \u003capp-header title=\"ANGULAR CUSTOME HEADER ELEMENT\"\u003e\u003c/app-header\u003e\n\n\n\u003eNote: Use ShodowDom View encapsulate if you the styles are conflicts \n\n\n## Examples \n   open the **custome-elements/index.html** file \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowhijackers%2Fsimple-angular-custom-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowhijackers%2Fsimple-angular-custom-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowhijackers%2Fsimple-angular-custom-element/lists"}