Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@ctrl/ngx-codemirror
Advanced tools
An Angular component wrapper for CodeMirror that extends ngModel
Based on:
https://github.com/JedWatson/react-codemirror - This project is mostly a port of react-codemirror
https://github.com/chymz/ng2-codemirror - Good to reference
codemirror
is a peer dependency and must also be installed
npm install @ctrl/ngx-codemirror codemirror
Import CodemirrorModule
and bring in the codemirror files for parsing the langague you wish to use.
// Added to NgModule
import { CodemirrorModule } from '@ctrl/ngx-codemirror';
// Import your required language in main.ts or at the root of your application
// see https://codemirror.net/mode/index.html
import 'codemirror/mode/javascript/javascript';
import 'codemirror/mode/markdown/markdown';
Import the css files
@import "~codemirror/lib/codemirror.css";
@import "~codemirror/theme/material.css";
Use The Component
<ngx-codemirror
[(ngModel)]="this.defaults[this.mode]"
[options]="{
lineNumbers: true,
mode: 'markdown',
}"
></ngx-codemirror>
All Inputs of ngModel
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 valueAll outputs of ngModel
focusChange
- called when the editor is focused or loses focusscroll
- called when the editor is scrolledcursorActivity
- called when the text cursor is movedMIT
FAQs
CodeMirror wrapper for Angular
The npm package @ctrl/ngx-codemirror receives a total of 31,835 weekly downloads. As such, @ctrl/ngx-codemirror popularity was classified as popular.
We found that @ctrl/ngx-codemirror demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.