Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 76fc37d

Browse files
Dan Finnie and paulrobertdouglasduteil
Dan Finnie and paulrobert
authored andcommitted
feat: add advancedRenderer options
1 parent c7953e7 commit 76fc37d

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ This will copy the UI.Ace files into a `bower_components` folder, along with its
112112
}"></div>
113113
```
114114

115+
To include options applicable to the ACE renderer, you can use the `rendererOptions` key:
116+
117+
```html
118+
<div ui-ace="{
119+
rendererOptions: {
120+
maxLinks: Infinity
121+
}
122+
}"></div>
123+
```
124+
115125
## Support for concatenated bundles
116126

117127
Trying to use ace with concatenated javascript files usually fails because it changes the physical location of the `workerPath`. If you

src/ui-ace.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,25 @@ angular.module('ui.ace', [])
9898
}
9999

100100
// advanced options
101+
var key, obj;
101102
if (angular.isDefined(opts.advanced)) {
102-
for (var key in opts.advanced) {
103+
for (key in opts.advanced) {
103104
// create a javascript object with the key and value
104-
var obj = { name: key, value: opts.advanced[key] };
105+
obj = { name: key, value: opts.advanced[key] };
105106
// try to assign the option to the ace editor
106107
acee.setOption(obj.name, obj.value);
107108
}
108109
}
110+
111+
// advanced options for the renderer
112+
if (angular.isDefined(opts.rendererOptions)) {
113+
for (key in opts.rendererOptions) {
114+
// create a javascript object with the key and value
115+
obj = { name: key, value: opts.rendererOptions[key] };
116+
// try to assign the option to the ace editor
117+
acee.renderer.setOption(obj.name, obj.value);
118+
}
119+
}
109120
};
110121

111122
return {

0 commit comments

Comments
 (0)