Невозможно применить applyDeltas в редакторе Ace в Angular 7 - PullRequest
0 голосов
/ 22 апреля 2019

Я пытаюсь обновить Ace-Code-Editor, который я установил отсюда https://www.npmjs.com/package/ng2-ace-editor

В API я пытаюсь найти applyDeltas(), заданное здесь https://ace.c9.io/#nav=api&api=document, но я не могу его найти.

Фрагмент кода

    this._thiscurrentdelta = this.codeeditorservice._currentCode.subscribe(changes => {
      this._changes = changes;
      if(this._last_applied_change != changes){
        this.editor.applyDeltas([changes] // doesn't work
        this.editor.getSession().applyDeltas([changes]) // doesn't work
        this.editor.getSession().getDocument().applyDeltas([changes]) // doesn't work
        this.editor.getDocument().applyDeltas([changes]) // doesn't work 
      }
    });

Все три подхода продолжают бросать, «функция не найдена»

1 Ответ

0 голосов
/ 22 апреля 2019

Оказывается, что вызов метода отличается от ч / б, если он используется в Node.js и в Angular:

https://github.com/fxmontigny/ng2-ace-editor/issues/62

this.editor.getEditor().sesson.getDocument().applydeltas(event);

...