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

Commit

Permalink
fix: ngModel update
Browse files Browse the repository at this point in the history
Closes #77
  • Loading branch information
rebornix authored and douglasduteil committed Jan 8, 2015
1 parent b0f02ce commit 491369a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ui-ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,10 @@ angular.module('ui.ace', [])
onChange: function (callback) {
return function (e) {
var newValue = session.getValue();
if (newValue !== scope.$eval(attrs.value) && !scope.$$phase && !scope.$root.$$phase) {
if (ngModel !== null) {
scope.$apply(function () {
ngModel.$setViewValue(newValue);
});
if (newValue !== scope.$eval(attrs.value)) {
if (angular.isDefined(ngModel)) {
ngModel.$setViewValue(newValue);
!scope.$$phase && !scope.$root.$$phase && scope.$digest();
}
executeUserCallback(callback, e, acee);
}
Expand Down

0 comments on commit 491369a

Please sign in to comment.