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

misojs-codemirror-component

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

misojs-codemirror-component

A code mirror component for use in misojs, also works with mithril through browserify

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

misojs-codemirror-component

A code mirror component for use in misojs

installation

In your main misojs application directory:

npm install misojs-codemirror-component --save

Usage

Acceess the component in your mvc entities like so:

var CodeMirror = require('misojs-codemirror-component')();

In your controller, you might set a value like so:

this.codeMirrorValue = m.prop([
	"for(var x = 0; x < 10; x += 1){",
	"    console.log(x);",
	"}"].join("\n")
);

And in your view:

m("div", [
	m("label", "Code mirror:"),
	m.component(CodeMirror, {
		value: ctrl.codeMirrorValue
	})
])

This will render a code mirror editor.

Isomorphism

The server generated code simply returns a textarea, whereas the client side code runs the code mirror editor.

Keywords

FAQs

Package last updated on 03 Aug 2015

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