Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Made ui-codemirror work with updateOn: 'blur' #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonreich
Copy link

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.

@floribon
Copy link

floribon commented Aug 4, 2016

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

@boutils
Copy link

boutils commented Oct 25, 2016

Workaround here:

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants