ui-codemirror icon indicating copy to clipboard operation
ui-codemirror copied to clipboard

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

Open Odalrick opened this issue 11 years ago • 4 comments
trafficstars

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.

Odalrick avatar May 30 '14 08:05 Odalrick

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.

WhatFreshHellIsThis avatar Jul 10 '14 15:07 WhatFreshHellIsThis

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

douglasduteil avatar Jul 10 '14 15:07 douglasduteil

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

douglasduteil avatar Jul 10 '14 15:07 douglasduteil

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.

WhatFreshHellIsThis avatar Jul 10 '14 18:07 WhatFreshHellIsThis