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

Commit df52604

Browse files
committed
fix: bad user callback digestion
Prefer using $applyAsync than $apply. Close #89
1 parent 425a92a commit df52604

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/ui-ace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ angular.module('ui.ace', [])
196196
var args = Array.prototype.slice.call(arguments, 1);
197197

198198
if (angular.isDefined(callback)) {
199-
scope.$apply(function () {
199+
scope.$applyAsync(function () {
200200
if (angular.isFunction(callback)) {
201201
callback(args);
202202
} else {

test/ace.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ describe('uiAce', function () {
308308
scope.$apply('foo = "bar"');
309309
$compile('<div ui-ace="{onChange: changing}" ng-model="foo">')(scope);
310310
_ace.getSession().setValue('baz');
311+
scope.$apply();
311312
}
312313

313314
expect(compileWithObject).toThrow();

0 commit comments

Comments
 (0)