{"id":15573004,"url":"https://github.com/fssolutions/ng2-combosearch","last_synced_at":"2025-06-28T22:33:33.184Z","repository":{"id":75864168,"uuid":"67726869","full_name":"fssolutions/ng2-combosearch","owner":"fssolutions","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-17T14:27:10.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T18:15:31.969Z","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/fssolutions.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-08T17:51:43.000Z","updated_at":"2019-12-17T14:27:12.000Z","dependencies_parsed_at":"2023-05-22T17:45:28.183Z","dependency_job_id":null,"html_url":"https://github.com/fssolutions/ng2-combosearch","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"d6ad2d3e29f82c3f0d0d37a611fc22c86adc8c3e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fssolutions%2Fng2-combosearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fssolutions%2Fng2-combosearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fssolutions%2Fng2-combosearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fssolutions%2Fng2-combosearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fssolutions","download_url":"https://codeload.github.com/fssolutions/ng2-combosearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246149889,"owners_count":20731405,"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-02T18:09:46.467Z","updated_at":"2025-03-29T06:30:02.417Z","avatar_url":"https://github.com/fssolutions.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/ng2-combosearch.svg)](https://badge.fury.io/js/ng2-combosearch)\n\n# ComboSearchComponent\n @version 2.0.2 \u003cbr\u003e\n @author: Flávio Silva \u003cbr\u003e\n @link: [https://github.com/fssolutions/ng2-combosearch](https://github.com/fssolutions/ng2-combosearch)\n\n## Installation\n\n Combosearch runs on angular 2 and is available as an NPM package. You can install ng2-combosearch\n in your project's directory as usual:\n\n```bash\n$ npm install --save ng2-combosearch\n```\n\nComponent combo search for Angular 2.\n```\n \u003ccombo-search nameDescription=\"var string\" [startFill]=\"[true|false|yes|no]\" [onDemand]=\"[true|false|yes|no]\" [modelList]=\"var [Array\u003cany\u003e]\" [(cpModel)]=\"var [any]\" (searchText)=\"onYourFunction($event)\" (selectItem)=\"onYourFunction($event)\"\u003e\n   \u003ctemplate let-currentItem\u003e\n     \u003cdiv\u003e\u003cb\u003e{{currentItem.Property1}}\u003c/b\u003e - {{currentItem.Propery2}}\u003c/div\u003e\n   \u003c/template\u003e\n \u003c/combo-search\u003e\n```\n\n## Example\n### Template (.html)\n```\n \u003ccombo-search nameDescription=\"nameModelToShow\" startFill=\"yes\" [modelList]=\"modelList\" (searchText)=\"onSearchText($event)\" (selectItem)=\"onSelectItem($event)\"\u003e\u003c/combo-search\u003e\n\n \u003ccombo-search nameDescription=\"nameModelToShow\" startFill=\"yes\" [modelList]=\"modelList\" (searchText)=\"onSearchText($event)\" (selectItem)=\"onSelectItem($event)\"\u003e\n   \u003ctemplate let-myVar\u003e\n     \u003cdiv\u003e\u003cb\u003e{{myVar.Id}}\u003c/b\u003e - {{myVar.Name}}({{myVar.User}})\u003c/div\u003e\n   \u003c/template\u003e\n \u003c/combo-search\u003e\n```\n### TypeScript (.ts)\n Import ComboSearchComponent\n```\n import { Ng2ComboSearchModule } from 'ng2-combosearch';\n```\n\n#### Add in your module\n```\n  @NgModule({   \n    imports: [\n     Ng2ComboSearchModule,\n    ]\n  })\n```\n\n Create var to bind\n```\n private nameModelToShow: string;\n private modelList: any;\n```\n\n Create function to receive data\n```\n private searchText(value: string){};\n private onSelectItem(value: any){};\n```\n\n### Complete Code\n```\n ...\n import { Ng2ComboSearchModule } from 'ng2-combosearch';\n\n ...\n   @NgModule({   \n     imports: [\n      Ng2ComboSearchModule,\n     ]\n   })\n\n ...\n export class YourClass{\n  private nameModelToShow: string = \"Name\";\n  private modelList: Array\u003cany\u003e = [\n      { Id: 1, Name: 'My Name', User: 'my.user', ImgProfile: '11652-589-5-689.png'},\n      { Id: 2, Name: 'My Name', User: 'my.user', ImgProfile: '11652-589-5-195.png'}\n  ];\n\n  private onSearchText(value: string){\n    console.info(\"Searching for: \", value);\n    // Load new model, when your search on demand;\n  };\n\n  private onSelectItem(value: any){\n    console.info(\"Selected Item: \", value);\n  };\n }\n```\n## Contributing\n\nContributions are welcome and appreciated. You can find ng2-combosearch on GitHub, feel free to start\nan issue or create a pull requests:\u003cbr\u003e\n[https://github.com/fssolutions/ng2-combosearch](https://github.com/fssolutions/ng2-combosearch)\n\n\n## License\n\nCopyright (c) 2016 Flávio Silva [fssolutions](http://www.flaviosilva.net).\u003cbr\u003e\nLicensed under the MIT License (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffssolutions%2Fng2-combosearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffssolutions%2Fng2-combosearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffssolutions%2Fng2-combosearch/lists"}