From a4a35a2531a0eb456a9adfb8fe36c93014c7f537 Mon Sep 17 00:00:00 2001 From: Michael Taranto Date: Mon, 8 Jul 2013 16:42:06 +1000 Subject: [PATCH] NgModelController demo fix for html injection into contenteditable directive The 'contenteditable' div and the textarea should be passing their text values between each other not their escaped inner html. This breaks the demo as the 'required' class is not applied when the 'contenteditable' div is cleared. --- src/ng/directive/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index a5fc56c82c3f..1bcd5b81d30d 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -876,7 +876,7 @@ var VALID_CLASS = 'ng-valid', // Specify how UI should be updated ngModel.$render = function() { - element.html(ngModel.$viewValue || ''); + element.text(ngModel.$viewValue || ''); }; // Listen for change events to enable binding @@ -887,7 +887,7 @@ var VALID_CLASS = 'ng-valid', // Write data to the model function read() { - ngModel.$setViewValue(element.html()); + ngModel.$setViewValue(element.text()); } } };