如何在验证错误时删除ace编辑器的内容

Sud*_*ip7 3 ace-editor

我的问题与将重点放在ace编辑器上有关

这次我想在出现验证错误时删除内容。

我有喜欢的模式

/^[0-4]$/ and /^([1-9][0-9]{0,3}|[1-5][0-9]{4}|60000)$/;
Run Code Online (Sandbox Code Playgroud)

分别检查0-4和1-60000之间的值。当用户提供无效数据时,将清除我的文本区域,但不会清除ace编辑器。我也试过

    $scope.close = function () {
rowObj.entity.value = editor.getValue();
            editor.setValue("",0);
                };
Run Code Online (Sandbox Code Playgroud)

但这不起作用。

a u*_*ser 6

清除编辑器只需调用 editor.setValue("")