{"id":18536074,"url":"https://github.com/khalidsheet/ngx-communicate","last_synced_at":"2026-03-16T15:32:48.118Z","repository":{"id":38653924,"uuid":"221971339","full_name":"khalidsheet/ngx-communicate","owner":"khalidsheet","description":"Share data between any two components in an easy way!","archived":false,"fork":false,"pushed_at":"2023-01-07T11:50:43.000Z","size":2025,"stargazers_count":4,"open_issues_count":26,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T16:00:49.057Z","etag":null,"topics":["angular","communicate","communication","ngx"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ngx-communicate","language":"HTML","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/khalidsheet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-15T17:22:09.000Z","updated_at":"2022-11-18T13:47:08.000Z","dependencies_parsed_at":"2023-02-07T02:00:32.547Z","dependency_job_id":null,"html_url":"https://github.com/khalidsheet/ngx-communicate","commit_stats":null,"previous_names":["prog98rammer/ngx-communicate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/khalidsheet/ngx-communicate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidsheet%2Fngx-communicate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidsheet%2Fngx-communicate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidsheet%2Fngx-communicate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidsheet%2Fngx-communicate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khalidsheet","download_url":"https://codeload.github.com/khalidsheet/ngx-communicate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalidsheet%2Fngx-communicate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261373443,"owners_count":23148915,"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","communicate","communication","ngx"],"created_at":"2024-11-06T19:29:50.801Z","updated_at":"2026-03-16T15:32:48.105Z","avatar_url":"https://github.com/khalidsheet.png","language":"HTML","readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0eb77784475f4ed1824fdda9ef00a0f6)](https://www.codacy.com/manual/prog98rammer/ngx-communicate?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=prog98rammer/ngx-communicate\u0026amp;utm_campaign=Badge_Grade) [![npm version](https://badge.fury.io/js/ngx-communicate.svg)](https://badge.fury.io/js/ngx-communicate)\n\n# NgxCommunicate\n\n**Share data between any two components in an easy way**\n\n## Installation\n\n```bash\nnpm i ngx-communicate\n```\n\n## Add the **NgxCommunicateModule** to your **AppModule**\n\n```ts\n@NgModule({\n ...\n  imports: [\n    ...\n    NgxCommunicateModule.forRoot()\n  ],\n  ...\n})\nexport class AppModule { }\n```\n\n## Use the Service\n\n**To broadcast data**\n\n```ts\nthis.communicate.broadcast(\"server:start\", \"Server Started\");\n```\n\n**To receive data**\n\n```ts\nthis.communicate.on(\"server:start\", (data: any) =\u003e {\n  console.log(data);\n});\n```\n\n---\n\n## Example\n\n```ts\nimport { NgxCommunicateService } from \"ngx-communicate\";\n\n@Component({\n  selector: \"app-root\",\n  templateUrl: \"./app.component.html\",\n  styleUrls: [\"./app.component.css\"]\n})\nexport class AppComponent implements OnInit {\n  constructor(private communicate: NgxCommunicateService) {}\n\n  ngOnInit() {\n    // Broadcasting a new event with it's data\n    this.communicate.broadcast(\"server:start\", \"Server Started\");\n\n    // Receive the data for that event.\n    // Note: It can be used inside any other component.\n    this.communicate.on(\"server:start\", (data: any) =\u003e {\n      console.log(data);\n    });\n  }\n}\n```\n\n### License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidsheet%2Fngx-communicate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalidsheet%2Fngx-communicate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalidsheet%2Fngx-communicate/lists"}