angular-ui / ui-codemirror

This directive allows you to add CodeMirror to your textarea elements.
http://angular-ui.github.io/ui-codemirror
MIT License
378 stars 193 forks source link

Error: uiCodemirror3 can only be applied to a textarea element #137

Open chengtie opened 7 years ago

chengtie commented 7 years ago

According to the doc of ui-codemirror:

The ui-codemirror directive plays nicely with ng-model.

The ng-model will be watched for to set the CodeMirror document value (by setValue).

The ui-codemirror directive stores and expects the model value to be a standard javascript String.

However, my code (JSBin) returns an error Error: uiCodemirror3 can only be applied to a textarea element in the console.

Could anyone help?

Cheers

ranadheerrannu commented 6 years ago

can you check this https://stackoverflow.com/questions/42245844/error-uicodemirror3-can-only-be-applied-to-a-textarea-element to which element you applied this directive ? it should be applied to textarea