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

Commit f1198bb

Browse files
darul75wesleycho
authored andcommitted
Merged with aeb1397
1 parent 1fbe30e commit f1198bb

File tree

1 file changed

+41
-28
lines changed

1 file changed

+41
-28
lines changed

README.md

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,70 @@ This directive allows you to add a TinyMCE editor to your form elements.
1010
# Testing
1111

1212
We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
13-
14-
npm install -g grunt-cli
15-
npm install
16-
bower install
17-
grunt
13+
```
14+
npm install -g grunt-cli
15+
npm install
16+
bower install
17+
grunt
18+
```
1819

1920
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`
2021

2122
# Usage
2223

2324
We use [bower](http://twitter.github.com/bower/) for dependency management. Add
2425

25-
dependencies: {
26-
"angular-ui-tinymce": "latest"
27-
}
26+
```
27+
dependencies: {
28+
"angular-ui-tinymce": "latest"
29+
}
30+
```
2831

2932
To your `bower.json` file. Then run
3033

31-
bower install
34+
```
35+
bower install
36+
```
3237

3338
This will copy the ui-tinymce files into your `components` folder, along with its dependencies. Load the script files in your application:
3439

35-
<script type="text/javascript" src="app/bower_components/tinymce/tinymce.min.js"></script>
36-
<script type="text/javascript" src="app/bower_components/angular/angular.js"></script>
37-
<script type="text/javascript" src="app/bower_components/angular-ui-tinymce/src/tinymce.js"></script>
40+
```html
41+
<script type="text/javascript" src="app/bower_components/tinymce/tinymce.js"></script>
42+
<script type="text/javascript" src="app/bower_components/angular/angular.js"></script>
43+
<script type="text/javascript" src="app/bower_components/angular-ui-tinymce/tinymce.js"></script>
44+
```
3845

3946
Add the tinymce module as a dependency to your application module:
4047

41-
var myAppModule = angular.module('MyApp', ['ui.tinymce'])
48+
```javascript
49+
var myAppModule = angular.module('MyApp', ['ui.tinymce'])
50+
```
4251

4352
Apply the directive to your form elements:
4453

45-
<form method="post">
46-
<textarea ui-tinymce ng-model="tinymceModel"></textarea>
47-
</form>
48-
54+
```html
55+
<form method="post">
56+
<textarea ui-tinymce ng-model="tinymceModel"></textarea>
57+
</form>
58+
```
4959
## Options
5060

5161
All the TinyMCE options can be passed through the directive.
5262

53-
myAppModule.controller('MyController', function($scope) {
54-
$scope.tinymceOptions = {
55-
handle_event_callback: function (e) {
56-
// put logic here for keypress
57-
}
58-
};
59-
});
60-
61-
<form method="post">
62-
<textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea>
63-
</form>
63+
```javascript
64+
myAppModule.controller('MyController', function($scope) {
65+
$scope.tinymceOptions = {
66+
handle_event_callback: function (e) {
67+
// put logic here for keypress
68+
}
69+
};
70+
});
71+
```
72+
```html
73+
<form method="post">
74+
<textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea>
75+
</form>
76+
```
6477

6578
## Working with ng-model
6679

0 commit comments

Comments
 (0)