Very nice codepen project with Angular. No coding or custom markup required! This project was generated with Angular CLI version 15.2.6.
codemirror
is a peer dependency and must also be installed
npm install @ctrl/ngx-codemirror codemirror@5
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
All Inputs of ngModel and
options
- options passed to the CodeMirror instance see http://codemirror.net/doc/manual.html#configname
- name applied to the created textareaautoFocus
- setting applied to the created textareapreserveScrollPosition
- preserve previous scroll position after updating value
All outputs of ngModel and
codeMirrorLoaded
- called when codeMirror instance is initiatedfocusChange
- called when the editor is focused or loses focusscroll
- called when the editor is scrolled (not wrapped inside angular change detection must manually trigger change detection or run inside ngzone)cursorActivity
- called when the text cursor is moveddrop
- called when file(s) are dropped