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

Commit f613fc0

Browse files
David HAN SZE CHUENkayhadrin
authored andcommitted
Move the "ace" function check inside the directive so that it only blurbs
when the user tries to use it
1 parent 15ad37c commit f613fc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ui-ace.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ angular.module('ui.ace', [])
77
.constant('uiAceConfig', {})
88
.directive('uiAce', ['uiAceConfig', function (uiAceConfig) {
99

10-
if (angular.isUndefined(window.ace)) {
11-
throw new Error('ui-ace need ace to work... (o rly?)');
12-
}
13-
1410
/**
1511
* Sets editor options such as the wrapping mode or the syntax checker.
1612
*
@@ -102,6 +98,10 @@ angular.module('ui.ace', [])
10298
*/
10399
var ace = opts.ace || window.ace;
104100

101+
if (!ace) {
102+
throw new Error('ui-ace need ace to work... (o rly?)');
103+
}
104+
105105
/**
106106
* ACE editor
107107
* @type object

0 commit comments

Comments
 (0)