Search code examples
javascriptangularjsace-editor

How to get Range when using angular ui ace?


Does anyone know how i can get Range with angular ui ace? If i am directly embedding ace in my html, i could probably do something like this:

var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");

    var Range = ace.require('ace/range').Range;

But how can i get this with angular ui ace? I have access to the model and the Editor class, but i guess this will require the ace object?

Ace documentation

angular ui ace

Thanks.


Solution

  • ace global variable is available with angular ui ace too. Try ace.require('ace/range').Range; in the console on ui-ace demo page http://angular-ui.github.io/ui-ace/