{"id":16244576,"url":"https://github.com/endykaufman/ngx-cold","last_synced_at":"2025-03-15T11:31:42.607Z","repository":{"id":35558590,"uuid":"218374524","full_name":"EndyKaufman/ngx-cold","owner":"EndyKaufman","description":"Two small directives for work with observable in Angular9+ without subscribe","archived":false,"fork":false,"pushed_at":"2024-09-06T09:19:35.000Z","size":2892,"stargazers_count":1,"open_issues_count":44,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-10-11T14:19:24.716Z","etag":null,"topics":["angular","async","click","cold","directives","form","rxjs","subscribe"],"latest_commit_sha":null,"homepage":"https://endykaufman.github.io/ngx-cold","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/EndyKaufman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-10-29T20:10:06.000Z","updated_at":"2021-04-01T10:09:05.000Z","dependencies_parsed_at":"2023-01-15T23:29:49.722Z","dependency_job_id":null,"html_url":"https://github.com/EndyKaufman/ngx-cold","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndyKaufman%2Fngx-cold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndyKaufman%2Fngx-cold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndyKaufman%2Fngx-cold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndyKaufman%2Fngx-cold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EndyKaufman","download_url":"https://codeload.github.com/EndyKaufman/ngx-cold/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221571695,"owners_count":16845507,"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","async","click","cold","directives","form","rxjs","subscribe"],"created_at":"2024-10-10T14:19:43.455Z","updated_at":"2024-10-26T19:33:01.037Z","avatar_url":"https://github.com/EndyKaufman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngx-cold\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/EndyKaufman/ngx-cold.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/EndyKaufman/ngx-cold.svg?branch=master)](https://travis-ci.org/EndyKaufman/ngx-cold)\n[![npm version](https://badge.fury.io/js/ngx-cold.svg)](https://badge.fury.io/js/ngx-cold)\n\nTwo small directives for work with observable in Angular9+ without subscribe:\n\n- \\*coldClick - easy way for run http post from template.\n- \\*coldForm - easy way for submit typed form data to remote server from template.\n\n## Installation\n\n```bash\nnpm i --save ngx-cold\n```\n\n## Links\n\n[Demo](https://endykaufman.github.io/ngx-cold) - Demo application with ngx-cold.\n\n[Stackblitz](https://stackblitz.com/edit/ngx-cold) - Simply sample of usage on https://stackblitz.com\n\n# Usage\n\n## Usage \\*coldClick\n\napp.module.ts\n\n```js\nimport { HttpClientModule } from '@angular/common/http';\nimport { NgxColdModule } from 'ngx-cold';\n\n@NgModule({\n  imports: [\n    ...\n    HttpClientModule,\n    NgxColdModule,\n    ...\n  ],\n  ...\n})\nexport class AppModule {}\n```\n\napp.component.html\n\n```html\n...\n\u003cp\u003eSave with *coldClick\u003c/p\u003e\n\u003cbutton\n  *coldClick=\"let coldSave of onSave\"\n  (click)=\"coldSave.call({userData:'custom data'})\"\n  [disabled]=\"coldSave.isLoading\"\n\u003e\n  {{ coldSave.isLoading ? 'Save in processing...' : 'Save' }}\n\u003c/button\u003e\n...\n```\n\napp.component.ts\n\n```js\nimport { HttpClient } from '@angular/common/http';\n...\nconstructor(private httpClient: HttpClient) {}\nonSave(data: any) {\n  return this.httpClient.post('/api/user', data);\n}\n...\n```\n\n## Usage \\*coldForm\n\napp.module.ts\n\n```js\nimport { HttpClientModule } from '@angular/common/http';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { NgxColdModule } from 'ngx-cold';\n\n@NgModule({\n  imports: [\n    ...\n    HttpClientModule,\n    NgxColdModule,\n    ReactiveFormsModule,\n    FormsModule,\n    ...\n  ],\n  ...\n})\nexport class AppModule {}\n```\n\napp.component.html\n\n```html\n...\n\u003cp\u003eSave with *coldForm\u003c/p\u003e\n\u003cdiv *coldForm=\"let coldForm of searchField; with: { delay: 700, change: onSearch, result: [] }\"\u003e\n  \u003cinput [formControl]=\"searchField\" /\u003e\n  \u003cdiv *ngIf=\"coldForm.isLoading\"\u003eLoading...\u003c/div\u003e\n  \u003cpre [innerText]=\"coldForm.result|async|json\"\u003e\u003c/pre\u003e\n\u003c/div\u003e\n...\n```\n\napp.component.ts\n\n```js\nimport { HttpClient } from '@angular/common/http';\nimport { FormControl } from '@angular/forms';\n...\nsearchField = new FormControl();\nconstructor(\n  private httpClient: HttpClient\n) {}\nonSearch(search: string) {\n  return this.httpClient.get('/api/users', {\n    params: {\n      search\n    }\n  });\n}\n...\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendykaufman%2Fngx-cold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendykaufman%2Fngx-cold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendykaufman%2Fngx-cold/lists"}