angular-ueditor is a prot of Baidu UEditor
The goal is to use UEditor whit angular easier
http://zqjimlove.github.io/angular-ueditor/
Include both the javascript
file of UEditor:
<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
Grab the latest release and javascript
file:
<script type="text/javascript" src="angular-ueditor.js"></script>
Then add angular-ueditor
to your modules dependencies:
angular.module('app', ['ng.ueditor'])
You should include the javascript
file of UEditor by yourself,because the UEDitor not in Bower
bower install angular-ueditor --save
Must bind NgModel
<div class="ueditor" ng-model="content"></div>
You can customize the UEditor by UE start config
<div class="ueditor" config="config" ng-model="content"></div>
...
<script>
$scope.config = {
...
}
</script>
**If Element ID exists then the editor will keep save the status and content **
Registers a listener callback to be executed whenever the editor ready.
parame | type | Details |
---|---|---|
listener | function(editor) | Callback called whenever the editor ready. |
<div class="ueditor" ready="ready" ng-model="content"></div>
...
<script type="text/javascript">
$scope.ready = function(editor){
alert(editor.getContent());
}
</script>
If you want to build from master, you need to:
npm install
grunt
npm install
npm test
Mit License: http://www.opensource.org/licenses/mit-license.php