Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit da10af3

Browse files
committed
Update documentation with warning
1 parent 51b7866 commit da10af3

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,25 @@ Apply the directive to your form elements:
5656
<textarea ui-tinymce ng-model="tinymceModel"></textarea>
5757
</form>
5858
```
59+
60+
**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.
61+
62+
## Working with ng-model
63+
64+
The ui-tinymce directive plays nicely with the ng-model directive such as ng-required.
65+
66+
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.
67+
68+
_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`)._
69+
5970
## Options
6071

61-
All the TinyMCE options can be passed through the directive, as well as some helpers.
72+
The directive supports all of the standard TinyMCE initialization options as listed [here](http://www.tinymce.com/wiki.php/Configuration).
73+
74+
In addition, it supports these additional optional options
75+
76+
- `format` Format to get content as, i.e. 'raw' for raw HTML, or 'text' for text only. Documentation [here](http://www.tinymce.com/wiki.php/api4:method.tinymce.Editor.getContent)
77+
- `trusted` When `true`, all TinyMCE content that is set to `ngModel` will be whitelisted by `$sce`
6278

6379
```javascript
6480
myAppModule.controller('MyController', function($scope) {
@@ -78,20 +94,3 @@ myAppModule.controller('MyController', function($scope) {
7894
<textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea>
7995
</form>
8096
```documentation
81-
82-
## Working with ng-model
83-
84-
The ui-tinymce directive plays nicely with the ng-model directive such as ng-required.
85-
86-
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.
87-
88-
_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`)._
89-
90-
## Options
91-
92-
The directive supports all of the standard TinyMCE initialization options as listed [here](http://www.tinymce.com/wiki.php/Configuration).
93-
94-
In addition, it supports these additional optional options
95-
96-
- `format` Format to get content as, i.e. 'raw' for raw HTML, or 'text' for text only. Documentation [here](http://www.tinymce.com/wiki.php/api4:method.tinymce.Editor.getContent)
97-
- `trusted` When `true`, all TinyMCE content that is set to `ngModel` will be whitelisted by `$sce`

0 commit comments

Comments
 (0)