{"id":17854769,"url":"https://github.com/godbasin/angular-select2","last_synced_at":"2025-03-20T11:37:06.193Z","repository":{"id":57179074,"uuid":"95179126","full_name":"godbasin/angular-select2","owner":"godbasin","description":"select2 in angular(\u003e=2.0-release).","archived":false,"fork":false,"pushed_at":"2019-04-19T20:05:02.000Z","size":152,"stargazers_count":15,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T04:32:59.727Z","etag":null,"topics":["angular","angular2","angular4","select2"],"latest_commit_sha":null,"homepage":"","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/godbasin.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}},"created_at":"2017-06-23T03:19:59.000Z","updated_at":"2021-03-27T23:32:25.000Z","dependencies_parsed_at":"2022-09-09T19:01:12.873Z","dependency_job_id":null,"html_url":"https://github.com/godbasin/angular-select2","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/godbasin%2Fangular-select2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godbasin%2Fangular-select2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godbasin%2Fangular-select2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godbasin%2Fangular-select2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godbasin","download_url":"https://codeload.github.com/godbasin/angular-select2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221232905,"owners_count":16781651,"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","angular2","angular4","select2"],"created_at":"2024-10-28T01:04:09.244Z","updated_at":"2024-10-28T01:04:10.656Z","avatar_url":"https://github.com/godbasin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular-Select2\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.1.\n\n## Instructions\nThis project is built for showing how to use angular-select2-component.\n\n# Angular-Select2-Component\n\nSource code in: [https://github.com/godbasin/angular4-select2/tree/npm-publish-code](https://github.com/godbasin/angular4-select2/tree/npm-publish-code).\n\n## Related Versions\n\nAngular-Select2-Component is baseed on these plugins and libs(version):\n- [angular(\u003e= 2.0-release)](https://angular.io/)\n- [jQuery](https://jquery.com/)\n- [select2](https://select2.github.io/)\n\n## How to use\n---\n### Install\n``` cmd\n// npm install\nnpm install angular-select2-component --save\n\n// if you have not installed jquery\nnpm install jquery --save\n```\n\n### Use as component\n1. Import component.\n\n``` javascript\n// import NgModule\nimport {NgModule} from '@angular/core';\n// import Select2Component\nimport {Select2Component} from 'angular-select2-component';\n\n@NgModule({\n  // ...\n  // declare components\n  declarations: [Select2Component]\n})\nexport class YourModule {\n}\n```\n\n2. Template.\n\n``` html\n\u003cselect2 [options]=\"options\" [settings]=\"{ setting: value }\" [(ngModel)]=\"optionSelected\" (onSelect)=\"onSelect($event)\"\u003e\u003c/select2\u003e\n```\n\n3. Compile settings.\n\nIf you have set the `include` or `exclude` option in your `tsconfig.json`, you need to include the `node_modules/angular-select2-component/index.ts` file.\n\n``` json\n// tsconfig.json\n{\n  // ... other options\n  \"include\": [\n    \"node_modules/angular-select2-component/index.ts\"\n  ]\n}\n```\n\n### Options\n- `options`: `option[]`\n  - select options for select2\n  - `option`: `{id: value, text: key}` or `string`\n- `ngModel`: option value that is selected\n  - `id` or `string` while multiple is disable\n  - `id[]` or `string[]` while multiple is enable\n- `onSelect`\n  - callback when option selected\n  - parmas: `option`(`{id: value, text: key, selected: ifSelected}` or `string`)\n- `settings`\n  - configurable settings, see [Select2 options API](https://select2.org/configuration/options-api)\n  - `setting`: `{ settingOption: value, settingOption: value }`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodbasin%2Fangular-select2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodbasin%2Fangular-select2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodbasin%2Fangular-select2/lists"}