Skip to content

Commit 87e26b5

Browse files
committed
Merge branch 'master' of github.com:froala/angular-froala
2 parents e059496 + 42dc0aa commit 87e26b5

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,32 @@ function myCtrl($scope){
6161
$scope.froalaOptions.froala("getSelection");
6262
```
6363
###Events
64-
- todo
64+
Events can be used one of two ways as an attribute on the directive, or passed in with the options.
65+
####Attribute
66+
_app.js_
67+
68+
```js
69+
$scope.editorOnFocus = function(e, editor){
70+
//Do Something
71+
}
72+
```
73+
_view.html_
74+
75+
```html
76+
<textarea froala="froalaOptions" ngModel="myHtml" froala-event-focus="editorOnFocus"></textarea>
77+
```
78+
###options
79+
_app.js_
80+
81+
```js
82+
$scope.froalaOptions = {
83+
inlineMode: false,
84+
placeholder: "Edit Me",
85+
events : {
86+
focus : function(e, editor) {/* ... */}
87+
}
88+
```
89+
6590
6691
###Displaying Html
6792

demo/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
};
2121

2222
$scope.onPaste = function(e, editor, html){
23-
return 'Hijacked ' + html;
24-
}
23+
//return 'Hijacked ' + html;
24+
};
2525

2626
$scope.onEvent = function(e, editor, a, b){
2727
console.log('onEvent', e.namespace, a, b);
28-
}
28+
};
2929

3030
});

demo/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<link rel="stylesheet" href="../bower_components/FroalaWysiwygEditor/css/froala_style.min.css" />
1313

1414
<script src="../bower_components/FroalaWysiwygEditor/js/froala_editor.min.js"></script>
15-
<script src="../bower_components/FroalaWysiwygEditor/js/froala_style.min.js"></script>
16-
<script src="../bower_components/FroalaWysiwygEditor/js/froala_content.min.js"></script>
15+
1716
<!-- Froala Plugins -->
1817
<script src="../bower_components/FroalaWysiwygEditor/js/plugins/tables.min.js"></script>
1918
<script src="../bower_components/FroalaWysiwygEditor/js/plugins/video.min.js"></script>

0 commit comments

Comments
 (0)