Skip to content

Commit ca630ff

Browse files
Fix for the issue #174
1 parent 1ad80a1 commit ca630ff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/angular-froala.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
require: 'ngModel',
3131
scope: scope,
3232
link: function(scope, element, attrs, ngModel) {
33-
if (jQuery) element = jQuery(element);
34-
33+
if (jQuery){ element = jQuery(element);
34+
// Create a blur event to update the data of ngModel
35+
element.on('blur', function () {
36+
ngModel.$setViewValue(element.innerHTML.text())
37+
});
38+
}
3539
var specialTag = false;
3640
if (SPECIAL_TAGS.indexOf(element.prop("tagName").toLowerCase()) != -1) {
3741
specialTag = true;

0 commit comments

Comments
 (0)