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

Commit 0a061f4

Browse files
committed
Merge pull request #80 from ebuildy/patch-1
Fix error if ng-model is not set Closes #73
2 parents 3519988 + 5e5ede9 commit 0a061f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ui-ace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ angular.module('ui.ace', [])
208208
return function (e) {
209209
var newValue = session.getValue();
210210
if (newValue !== scope.$eval(attrs.value) && !scope.$$phase && !scope.$root.$$phase) {
211-
if (angular.isDefined(ngModel)) {
211+
if (ngModel !== null) {
212212
scope.$apply(function () {
213213
ngModel.$setViewValue(newValue);
214214
});
@@ -238,7 +238,7 @@ angular.module('ui.ace', [])
238238
});
239239

240240
// Value Blind
241-
if (angular.isDefined(ngModel)) {
241+
if (ngModel !== null) {
242242
ngModel.$formatters.push(function (value) {
243243
if (angular.isUndefined(value) || value === null) {
244244
return '';

0 commit comments

Comments
 (0)