{"id":16117900,"url":"https://github.com/aelbore/ngx-elements","last_synced_at":"2025-03-17T18:30:39.103Z","repository":{"id":35021044,"uuid":"197290961","full_name":"aelbore/ngx-elements","owner":"aelbore","description":"Wrap and register your Angular Ivy Component as custom element","archived":false,"fork":false,"pushed_at":"2023-01-06T09:02:17.000Z","size":785,"stargazers_count":22,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-24T18:23:53.287Z","etag":null,"topics":["angular","customelements","elements","ivy","rollup","webcomponents"],"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/aelbore.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}},"created_at":"2019-07-17T01:18:28.000Z","updated_at":"2023-01-12T15:16:15.000Z","dependencies_parsed_at":"2023-01-15T12:10:33.439Z","dependency_job_id":null,"html_url":"https://github.com/aelbore/ngx-elements","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/aelbore%2Fngx-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelbore%2Fngx-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelbore%2Fngx-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aelbore%2Fngx-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aelbore","download_url":"https://codeload.github.com/aelbore/ngx-elements/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878439,"owners_count":20362432,"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":["angular","customelements","elements","ivy","rollup","webcomponents"],"created_at":"2024-10-09T20:47:37.115Z","updated_at":"2025-03-17T18:30:38.846Z","avatar_url":"https://github.com/aelbore.png","language":"TypeScript","readme":"[![npm version](https://badge.fury.io/js/ngx-elements.svg)](https://www.npmjs.com/package/ngx-elements)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n# ngx-elements\nWrap and register your Angular Ivy Component as custom element\n\nGetting Started\n------------\n* Install dependencies\n  ```\n  git clone https://github.com/aelbore/ngx-elements.git\n  cd ngx-elements\n  npm install\n  ```\n\nInstallation\n------------\n  ```\n    npm install ngx-elements\n  ```\n\nExample\n------------\n* `npm run ngcc` - compile all `@angular/*` libraries into ivy compatible\n* `npm run build` - build `ngx-elements`\n* `npm run build:profile` - build the example code\n* `npm run serve` - run into browser `http://localhost:5000`\n\nAPI\n-----\n* `renderCustomElement` - wrap and register your component into custom element (web components)\n* `renderNgComponent` - wrap your component to automatically have change detection\n\nFeatures\n-----\n* [Constructable Stylesheets](https://developers.google.com/web/updates/2019/02/constructable-stylesheets)\n* AutoChangeDetectChanges\n* Register Multiple Components, Directives, and Pipes\n  ```typescript\n  renderCustomElement(HelloWorldComponent, {\n   directives: [ NgForOf, MyTabItemComponent, MyTabComponent ],\n   pipes: [ AsyncPipe ]\n  }) \n  ```\n\nUsage\n-----\n* Create `hello-world.ts`\n  - When you change the value of `\u003cinput\u003e` it will trigger the change detection (`detectChanges`) to update the `\u003ch1\u003e` element\n  - by default it will trigger the change dectection when any of the properties changed\n    ```typescript\n    import { Component, ViewEncapsulation, Input } from \"@angular/core\";\n    import { renderCustomElement } from 'ngx-elements'\n\n    @Component({\n      selector: \"hello-world\",\n      template: `\n        \u003ch1\u003eHello {{ name }}\u003c/h1\u003e\n        \u003cinput \n          [value]=\"name\" \n          (input)=\"updateName($event.target.value)\" \n         /\u003e\n      `,\n      styles: [`\n        h1 { \n         color: var(--h1-color, blue) \n        }\n      `],\n      encapsulation: ViewEncapsulation.ShadowDom\n    })\n    export class HelloWorldComponent {\n      \n      @Input() name: string = \"World\"\n\n      updateName(newName: string) {\n        this.name = newName\n      }\n\n    }\n\n    renderCustomElement(HelloWorldComponent)\n    ```\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelbore%2Fngx-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faelbore%2Fngx-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faelbore%2Fngx-elements/lists"}