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

Made ui-codemirror work with updateOn: 'blur'

Open jasonreich opened this issue 9 years ago • 2 comments

Adjusted slightly to respect "updateOn" ngModelOption attributes. Previously, if one specified {updateOn: 'blur'}, the model would never update.

The specific changes are;

  1. A modification of `src/ui-codemirror.js' to add the necessary debounce and commit code (follows that in angular's ngmodel directive).
  2. An additional unit test for the {updateOn: 'blur'} case.

jasonreich avatar Aug 11 '15 12:08 jasonreich

+1 this is really needed, has uiCodemirror development being abandoned?

floribon avatar Aug 04 '16 10:08 floribon

Workaround here:

$scope.editorOptions = {
    onLoad: function(editor) {
        editor.on('blur', function() {
            $scope.myModel = editor.getValue();
        })
    }
}

boutils avatar Oct 25 '16 07:10 boutils