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

Commit

Permalink
fix: bad user callback digestion
Browse files Browse the repository at this point in the history
Prefer using $applyAsync than $apply.

Close #89
  • Loading branch information
douglasduteil committed Jan 11, 2015
1 parent 425a92a commit df52604
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui-ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ angular.module('ui.ace', [])
var args = Array.prototype.slice.call(arguments, 1);

if (angular.isDefined(callback)) {
scope.$apply(function () {
scope.$applyAsync(function () {
if (angular.isFunction(callback)) {
callback(args);
} else {
Expand Down
1 change: 1 addition & 0 deletions test/ace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ describe('uiAce', function () {
scope.$apply('foo = "bar"');
$compile('<div ui-ace="{onChange: changing}" ng-model="foo">')(scope);
_ace.getSession().setValue('baz');
scope.$apply();
}

expect(compileWithObject).toThrow();
Expand Down

0 comments on commit df52604

Please sign in to comment.