perak / codemirror

CodeMirror editor for Meteor >= 1.0
27 stars 15 forks source link

Cannot change code #15

Open mats68 opened 9 years ago

mats68 commented 9 years ago

Hello

The code (editorCode) is initially correct, but cannot change it afterwards (show correct in alert):

{{> CodeMirror id="edJs" name="someName" options=editorOptions code=editorCode }}

editorOptions: function() { return { lineNumbers: true, mode: "javascript" } }, editorCode: function() { alert(this.js); return this.js; }

perak commented 9 years ago

@mats68 excuse me for late answer :(

editorCode is not reactive. To change code dynamically, try using reactiveVar (see README.md)