angular-ui/ui-codemirror

ui-codemirror-opts doesn't update the editor when the options change

Odalrick opened this issue · 4 comments

If you use <ui-codemirror ui-codemirror-opts="editorOptions"></ui-codemirror> and change editorOptions; for instance change the readonly property; the editor will not update.

It works with <textarea ui-codemirror="editorOptions" ng-model="x"></textarea> though.

Yes, just came to report this issue also.

It appears that the documentation is incorrect as it states to use 'ui-codemirror-opts' but in fact you must use 'ui-codemirror' (no '-opts') or the code is incorrect because setting ui-codemirror-opts results in a blank editor that does nothing but setting 'ui-codemirror' with the options value does work correctly.

ui-codemirror-opts disappear in the latest version (v0.1.5) due to a drastic regression to support ng-repeat/ng-if/... and textarea

So basically you can't use the directive as an element for now :(

Not sure you fully understand what's being reported here @douglasduteil , the ui-codemirror-opts does nothing, didn't before the latest version either because I only updated to the latest version today and it didn't work before today either so I had to use ui-codemirror= instead. Though I'm not certain how I discovered that, probably looking at a demo page or something.