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

Commit 15ad37c

Browse files
David HAN SZE CHUENkayhadrin
authored andcommitted
Add ability to use another "ace" function from the directive's input
attribute This is useful when using this directive inside a popup window that has its own "ace" function.
1 parent f9fdb9a commit 15ad37c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ui-ace.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,18 @@ angular.module('ui.ace', [])
9595
*/
9696
var opts = angular.extend({}, options, scope.$eval(attrs.uiAce));
9797

98+
/**
99+
* ACE library reference
100+
* Use our own "ace" reference or use the global one.
101+
* @type object
102+
*/
103+
var ace = opts.ace || window.ace;
104+
98105
/**
99106
* ACE editor
100107
* @type object
101108
*/
102-
var acee = window.ace.edit(elm[0]);
109+
var acee = ace.edit(elm[0]);
103110

104111
/**
105112
* ACE editor session.

0 commit comments

Comments
 (0)