javascript - CodeMirror going into infinite loop when implementing on change function -



javascript - CodeMirror going into infinite loop when implementing on change function -

i need track alter in codemirror editor. implemented:

codemirrorinstance.on("change", function(codemirrorinstance){ $scope.onchangefunc(codemirrorinstance); } );

in onchangefunc insert based on status new value using

codemirrorinstance.setvalue(newcode);

apparently leads infinite loop. how break vicious circle?

setvalue trigger "change" event (it changes content, after all). you'll have create alter handler clever plenty not cause additional changes changes caused. looking @ origin property of sec argument passed "change" event handler might work -- contains sting identifies source of change, "setvalue" when setvalue called.

javascript angularjs codemirror

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -