{"id":22514656,"url":"https://github.com/worktile/ng-codemirror","last_synced_at":"2025-08-03T16:31:13.052Z","repository":{"id":40250606,"uuid":"245173276","full_name":"worktile/ng-codemirror","owner":"worktile","description":"Codemirror binding for Angular","archived":false,"fork":false,"pushed_at":"2024-11-15T10:50:54.000Z","size":6381,"stargazers_count":17,"open_issues_count":3,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-15T11:18:42.135Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/worktile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2020-03-05T13:40:57.000Z","updated_at":"2024-11-15T10:50:34.000Z","dependencies_parsed_at":"2024-03-07T07:43:58.913Z","dependency_job_id":"fa758ca9-7071-4519-9a4d-8fe1e59dda34","html_url":"https://github.com/worktile/ng-codemirror","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fng-codemirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fng-codemirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fng-codemirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worktile%2Fng-codemirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worktile","download_url":"https://codeload.github.com/worktile/ng-codemirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228553249,"owners_count":17935962,"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-12-07T03:20:05.776Z","updated_at":"2024-12-07T03:20:06.511Z","avatar_url":"https://github.com/worktile.png","language":"TypeScript","readme":"# Angular - Codemirror component\n\ncodemirror component for Angular（^8.0+）\n\nHas been formally verified by the production environment。\n\n## Features\n\n- support copy text in readOnly 'nocursor' mode.\n- ensure init codemirror after nativeElement has been attached （codemirror need a real element width）.\n- support flexiable height by autoMaxHeight.\n- support all options by codemirror（^5.52.0）.\n\n## Alternatives\n\n- [ngx-codemirror](https://github.com/TypeCtrl/ngx-codemirror): An Angular component wrapper for CodeMirror that extends ngModel.\n\n## Installation\n\n```bash\n$ npm i ng-codemirror --save\n// or\n$ yarn add ng-codemirror\n```\n\n## Usage\n\nImport `CodemirrorModule` and bring in the [codemirror files for parsing the langague](https://codemirror.net/mode/index.html) you wish to use.\n\nIn your `NgModule`:\n\n```ts\nimport { NgModule } from '@angular/core';\nimport { CodemirrorModule } from 'ng-codemirror';\n\n  // add to imports:\n  imports: [\n    BrowserModule,\n    CodemirrorModule,\n    ...\n  ]\n```\n\nIn your `main.ts` or at the root of your application, see [documentation](https://codemirror.net/mode/index.html):\n\n```ts\nimport \"codemirror/mode/javascript/javascript\";\nimport \"codemirror/mode/markdown/markdown\";\n```\n\nImport the scss file\n\n```scss\n@import \"~ng-codemirror/index.scss\";\n```\n\nUse The Component\n\n```html\n\u003cng-codemirror\n  [options]=\"options\"\n  [ngModel]=\"code\"\n  [autoMaxHeight]=\"300\"\n\u003e\u003c/ng-codemirror\u003e\n```\n\n```TS\n  // options 配置\n  options = {\n    lineNumbers: true,\n    readOnly: false, // nocursor can not copy\n    mode: 'javascript',\n    autofocus: true,\n    lineWiseCopyCut: true,\n    cursorBlinkRate: 500 // hide cursor\n  };\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworktile%2Fng-codemirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworktile%2Fng-codemirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworktile%2Fng-codemirror/lists"}