Skip to content

Commit 51c88cf

Browse files
Merge pull request #8 from shashankaccolite/version3
Updated Readme.md for version 3.0
2 parents a7ca071 + b2d1b7a commit 51c88cf

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ This repository contains bindings for the latest version of the Froala Editor (v
1414

1515
1. Clone this repo or download the zip.
1616

17-
2. Run `bower install` or Download the editor from [https://www.froala.com/wysiwyg-editor/](https://www.froala.com/wysiwyg-editor/) and jQuery
17+
2. Run `bower install` or Download the editor from [https://www.froala.com/wysiwyg-editor/](https://www.froala.com/wysiwyg-editor/)
1818

19-
3. Load Froala WYSIWYG editor (and all desired plugins), jQuery and the angular-froala files into your project.
19+
3. Load Froala WYSIWYG editor (and all desired plugins) and the angular-froala files into your project.
2020
- src/angular-froala.js
2121

22-
***NB***: You must ensure jQuery is included *before* angular, otherwise Angular will use it's own jqLite which doesn't provide the necessary functions.
23-
2422
## Update editor
2523

2624
With npm:

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)