Skip to content

Commit 7ddc459

Browse files
Changes for the issue #174 (ng-model-options updateOn blur not working) in angular-froala.js file.
Signed-off-by: Shashank <shashank.sharma@accoliteindia.com>
1 parent 48e9750 commit 7ddc459

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/angular-froala.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
froalaOptions: '=froala',
1818
initFunction: '&froalaInit'
1919
};
20-
20+
2121
froalaConfig = froalaConfig || {};
2222

2323
// Constants
@@ -30,8 +30,13 @@
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+
39+
}
3540
var specialTag = false;
3641
if (SPECIAL_TAGS.indexOf(element.prop("tagName").toLowerCase()) != -1) {
3742
specialTag = true;

0 commit comments

Comments
 (0)