You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please, do not open issues for the general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [StackOverflow](http://stackoverflow.com/questions/tagged/angular-ui-tinymce) where maintainers are looking at questions questions tagged with `angular-ui-tinymce`.
4
+
5
+
StackOverflow is a much better place to ask questions since:
6
+
* there are hundreds of people willing to help on StackOverflow
7
+
* questions and answers stay available for public viewing so your question / answer might help someone else
8
+
* SO voting system assures that the best answers are prominently visible.
9
+
10
+
To save your and our time we will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow.
11
+
12
+
## You think you've found a bug?
13
+
14
+
Oh, we are ashamed and want to fix it asap! But before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a _minimal_ reproduce scenario using http://plnkr.co/. Having a live reproduce scenario gives us wealth of important information without going back & forth to you with additional questions like:
15
+
* version of AngularJS used
16
+
* version of this library that you are using
17
+
* 3rd-party libraries used, if any
18
+
* and most importantly - a use-case that fails
19
+
20
+
A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.
21
+
22
+
We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal plunk. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
23
+
24
+
Unfortunately we are not able to investigate / fix bugs without a minimal reproduce scenario using http://plnkr.co/, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.
25
+
26
+
27
+
## You want to contribute some code?
28
+
29
+
We are always looking for the quality contributions and will be happy to accept your Pull Requests as long as those adhere to some basic rules:
30
+
31
+
* Please open all pull requests against the `master` branch.
32
+
* Please assure that you are submitting quality code, specifically make sure that:
33
+
* You have accompanying tests and all the tests are passing. See testing below.
34
+
* Your PR doesn't break the build; check the Travis-CI build status after opening a PR and push corrective commits if anything goes wrong
35
+
* You are using 2 space indentation
36
+
* Your commits conform to the conventions established [here](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)
[](https://gitter.im/angular-ui/ui-tinymce?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
+
6
+
# Call for Maintainer
7
+
8
+
This library is looking for a maintainer. If you feel up to the task please open an issue indicating so.
4
9
5
10
# Requirements
6
11
7
-
- AngularJS
12
+
- AngularJS 1.4.x or higher and it has been tested with Angular 1.4.8.
8
13
- TinyMCE 4
9
14
10
15
# Testing
@@ -17,7 +22,7 @@ bower install
17
22
grunt
18
23
```
19
24
20
-
The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in `test\test.config.js`
25
+
The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in `test\test.config.js`
21
26
22
27
# Usage
23
28
@@ -40,7 +45,7 @@ This will copy the ui-tinymce files into your `components` folder, along with it
**Be sure not to set an `id` attribute**. This is because the directive needs to maintain selector knowledge in order to handle buggy behavior in TinyMCE when DOM manipulation is involved, such as in a reordering of HTML through ng-repeat or DOM destruction/recreation through ng-if.
66
+
67
+
When using other directives which do DOM manipulation involving elements with `ui-tinymce`, you may need to re-render the editor due to this buggy behavior with TinyMCE. For those situations, it is recommended to use the `$tinymce:refresh` event, which will handle re-rendering the editor to fix this problem.
68
+
69
+
## Working with ng-model
70
+
71
+
The ui-tinymce directive plays nicely with the ng-model directive such as ng-required.
72
+
73
+
If you add the ng-model directive to same the element as ui-tinymce then the text in the editor is automatically synchronized with the model value.
74
+
75
+
_The ui-tinymce directive stores the configuration options as specified in the [TinyMCE documentation](http://www.tinymce.com/wiki.php/Configuration) and expects the model value to be a html string or raw text, depending on whether `raw` is `true` (default value is `false`)._
76
+
77
+
**Note:** Make sure you using scopes correctly by following [this wiki page](https://github.com/angular/angular.js/wiki/Understanding-Scopes). If you are having issues with your model not updating, make sure you have a '.' in your model.
78
+
79
+
> This issue with primitives can be easily avoided by following the "best practice" of always have a '.' in your ng-models – watch 3 minutes worth. Misko demonstrates the primitive binding issue with ng-switch.
80
+
59
81
## Options
60
82
61
-
All the TinyMCE options can be passed through the directive.
83
+
The directive supports all of the standard TinyMCE initialization options as listed [here](http://www.tinymce.com/wiki.php/Configuration).
84
+
85
+
Use the [setup](https://www.tinymce.com/docs/configure/integration-and-setup/#setup) function to bind different events:
86
+
87
+
```javascript
88
+
scope.tinymceOptions= {
89
+
setup:function(editor) {
90
+
//Focus the editor on load
91
+
$timeout(function(){ editor.focus(); });
92
+
editor.on("init", function() {
93
+
...
94
+
});
95
+
editor.on("click", function() {
96
+
...
97
+
});
98
+
}
99
+
};
100
+
```
101
+
By default all TinyMCE content that is set to `ngModel` will be whitelisted by `$sce`.
102
+
103
+
In addition, it supports these additional optional options
104
+
105
+
-`format` Format to get content as, i.e. 'raw' for raw HTML, or 'text' for text only. Defaults to 'html'. Documentation [here](http://www.tinymce.com/wiki.php/api4:method.tinymce.Editor.getContent)
106
+
-`baseURL` This will set [baseURL property on the EditorManager](https://www.tinymce.com/docs/api/class/tinymce.editormanager/)
107
+
-`debounce` This will debounce the model update which helps with performance of editors with large text. Defaults to true.
108
+
109
+
This option is only supported when present on the `uiTinymceConfig` global injectable - this injectable needs to be an object.
110
+
111
+
-`baseUrl` Sets the base url used by tinymce asset loading
0 commit comments