ngMeditor是用于AngularJS的Medium样式编辑器。
特性:
Header1-6/Bold/Itatic/underline/(un)orderlist/hr/justfy.
支持代码输入.仅需在行开始处输入```,或格式化它.
支持Tab键.
添加空白到URL并插入到链接。
扔掉或选择图片插入,或者只从剪切板粘贴,图片存到QiniuCloud.
使用示例:
<script type="text/javascript" src="bower_components/angular/angular.js"></script><script type="text/javascript" src="bower_components/ng-file-upload/angular-file-upload-shim.js"></script><script type="text/javascript" src="bower_components/ng-file-upload/angular-file-upload.js"></script><script type="text/javascript" src="src/editor.js"></script><link rel="stylesheet" href="src/editor.css"><link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.css"><ng-meditor ng-model="content" placeholder="placeholder"></ng-meditor>JS:
//inject ngMeditor directives and services.angular.module("ieditor", ['angularFileUpload','ngMeditor']);// configangular.module("ieditor").run(function ($http, meditorProvider) { meditorProvider.config({ supportCommands:['justfy', 'bold', 'italic', 'underline', 'H1', 'hr', 'code', 'insertOrderedList', 'eraser', 'image', 'fullscreen'], qnConfig: { endPoint: 'https://upload.qiniu.com', tokenFunc: function () { return $http.post('/token'); } } } );})
评论