diff --git a/README.md b/README.md index 17e3553..9d24ef6 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,14 @@ This should be the folder on disk where `ace.js` resides. workerPath: '/path/to/ace/folder' }"> ``` +You could also set the `basePath` option, which will force ace to look for all workers and themes in the folder you specify. + +```html +
+``` +Please note that ace requests workers and themes dynamically, so bundling them and referencing the bundle using `basePath` doesn't work. ### Working with ng-model diff --git a/src/ui-ace.js b/src/ui-ace.js index a664fb1..e7e4164 100644 --- a/src/ui-ace.js +++ b/src/ui-ace.js @@ -30,11 +30,16 @@ angular.module('ui.ace', []) */ var setOptions = function(acee, session, opts) { - // sets the ace worker path, if running from concatenated - // or minified source - if (angular.isDefined(opts.workerPath)) { + // sets the ace base and/or worker path, + // if running from concatenated or minified source + if (angular.isDefined(opts.workerPath) || angular.isDefined(opts.basePath)) { var config = window.ace.require('ace/config'); - config.set('workerPath', opts.workerPath); + if (angular.isDefined(opts.basePath)) { + config.set('basePath', opts.basePath); + } + if (angular.isDefined(opts.workerPath)) { + config.set('workerPath', opts.workerPath); + } } // ace requires loading if (angular.isDefined(opts.require)) {