Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-codemirror-typescript

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-codemirror-typescript

Angular2 Codemirror component

  • 3.13.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Angular2 - Codemirror component

Typescript version of https://github.com/chymz/ng2-codemirror

Installation

  • Include Codemirror javascript files in your application (with files for modes)
  • Install ng2-codemirror-typescript
    • NPM : npm install ng2-codemirror-typescript

Dependencies

CodeMirror library is required for this component :

  • Install via NPM : npm install codemirror

CodeMirror need to be accessible by import 'codemirror'

Then you need to include base CSS of codemirror located in codemirror/lib/codemirror.css

Pay attention, if you want to use placeholder you need to import codemirror/addon/display/placeholder.js

Sample (ES2016+)

Include CodemirrorModule in your main module :

import {CodemirrorModule} from 'ng2-codemirror/Codemirror';

@NgModule({
  // ...
  imports:      [
    CodemirrorModule
  ],
  // ...
})
export class AppModule { }
import {Component} from 'angular2/core';

@Component({
  selector: 'sample',
  template: `<codemirror [(ngModel)]="code" [config]="{...}" placeholder="Here is the code placeholder"></codemirror>`
})
export class Sample{
  constructor(){
    this.code = `// Some code...`;
  }
}

Keywords

FAQs

Package last updated on 23 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc