{"id":23752763,"url":"https://github.com/ziv/embed","last_synced_at":"2025-08-02T16:03:51.287Z","repository":{"id":68104613,"uuid":"295707451","full_name":"ziv/embed","owner":"ziv","description":"Angular component for embedding angular app","archived":false,"fork":false,"pushed_at":"2020-09-22T08:17:16.000Z","size":505,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T10:04:29.288Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ziv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-15T11:37:07.000Z","updated_at":"2020-09-22T08:17:18.000Z","dependencies_parsed_at":"2023-05-01T01:00:51.597Z","dependency_job_id":null,"html_url":"https://github.com/ziv/embed","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ziv/embed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziv","download_url":"https://codeload.github.com/ziv/embed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fembed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268360546,"owners_count":24238247,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-31T17:55:39.159Z","updated_at":"2025-08-02T16:03:51.250Z","avatar_url":"https://github.com/ziv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @xpr/embed - Angular Embed\n\nAn easy way to embed Angular application in another Angular application.\n\n## Install\n```\nnpm install @xpr/embed\n```\n\n## Embedded Application\nPreparing embedded Angular app steps:\n* Make sure your root components selector (usually `AppComponent`) is not `app-root` (to avoid collision with hosting app).\n* Add `@angular/elements` to your app\n  ```\n  ng add @angular/elements\n  ```\n* Add `ngx-build-plus` builder and generate web-components polyfills\n  ```\n  ng add ngx-build-plus\n  ng g ngx-build-plus:wc-polyfill\n  ```\n* Change your `AppModule` to define a custom element from your root component\n  ```typescript\n  import {createCustomElement} from '@angular/elements';\n  ...\n  export class AppModule implements DoBootstrap {\n     constructor(private injector: Injector) {\n      }\n  \n      ngDoBootstrap(appRef: ApplicationRef): void {\n        const el = createCustomElement(AppComponent, {injector: this.injector});\n        customElements.define('my-app', el);\n      }\n  }\n  ```\n* Build yor app using\n  ```\n  ng build  --prod --output-hashing=none --single-bundle\n  ```\n  \n## Host Application  \n* Copy embedded generated files `main.js`, `polyfill-webcomp.js` and `styles.css` into your `src/assets` directory of your host app.\n* Install `@xpr/embed`\n  ```\n  npm i @xpr/embed\n  ```\n* Import `XprEmbed` module to your `AppModule`\n* Add `xpr-embed` tag to your template:\n  ```html\n  \u003cxpr-embed tag=\"my-app\"\u003e\u003c/xpr-embed\u003e\n  ```\n\n## Embedding App Solution Explained\nThis project started as research at my workplace. How to start using last Angular without updating our core legacy application (Angular 5).\nWhile searching for solutions using @angular/elements (converting Angular app into Web Component) - I realized that using `shadow DOM` may provide the required solution for this problem.\n`ngembed` is the results of this research.\n\n=Z=\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziv%2Fembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziv%2Fembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziv%2Fembed/lists"}