This repository was archived by the owner on Sep 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -53,27 +53,31 @@ Apply the directive to your form elements:
53
53
54
54
``` html
55
55
<form method =" post" >
56
- <textarea ui-tinymce ng-model =" tinymceModel" ></textarea >
56
+ <textarea ui-tinymce ng-model =" tinymceModel" ></textarea >
57
57
</form >
58
58
```
59
59
## Options
60
60
61
- All the TinyMCE options can be passed through the directive.
61
+ All the TinyMCE options can be passed through the directive, as well as some helpers .
62
62
63
63
``` javascript
64
64
myAppModule .controller (' MyController' , function ($scope ) {
65
- $scope .tinymceOptions = {
66
- handle_event_callback : function (e ) {
67
- // put logic here for keypress
68
- }
69
- };
65
+ $scope .tinymceOptions = {
66
+ onChange : function (e ) {
67
+ // put logic here for keypress and cut/paste changes
68
+ },
69
+ inline: false ,
70
+ plugins : ' advlist autolink link image lists charmap print preview' ,
71
+ skin: ' lightgray' ,
72
+ theme : ' modern'
73
+ };
70
74
});
71
75
```
72
76
``` html
73
77
<form method =" post" >
74
- <textarea ui-tinymce =" tinymceOptions" ng-model =" tinymceModel" ></textarea >
78
+ <textarea ui-tinymce =" tinymceOptions" ng-model =" tinymceModel" ></textarea >
75
79
</form >
76
- ```
80
+ ```documentation
77
81
78
82
## Working with ng-model
79
83
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ angular.module('ui.tinymce', [])
23
23
if ( ! $rootScope . $$phase ) {
24
24
scope . $apply ( ) ;
25
25
}
26
+ if ( angular . isFunction ( options . onChange ) ) {
27
+ options . onChange ( ) ;
28
+ }
26
29
} ;
27
30
28
31
// generate an ID if not present
You can’t perform that action at this time.
0 commit comments