- A two-way binding is set up between
value
and the text in the editor. - Configure Ace in the
aceInit
callback.
Template
Controller
App.MyController = Ember.ObjectController.extend({
value: "Text to be manipulated with the Ace editor."
aceInit: function(editor) {
editor.setHighlightActiveLine(false);
editor.setShowPrintMargin(false);
editor.getSession().setTabSize(2);
editor.getSession().setMode("ace/mode/javascript");
}
});
Remember that, as usual with Ace, you must set css width and height on the element for it to be displayed. You can add class and id to the element as usual, as shown in the example template above.