Nauseating Pumpkin Mush

    misojs-codemirror-component

    0.0.7 • Public • Published

    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.

    Install

    npm i misojs-codemirror-component

    DownloadsWeekly Downloads

    0

    Version

    0.0.7

    License

    MIT

    Last publish

    Collaborators

    • jsguy