├── .gitignore ├── Gruntfile.js ├── LICENSE ├── README.md ├── bower.json ├── package.json ├── src └── angular-simditor.js └── tests ├── angular-simditor.js ├── app.js ├── index.html └── test.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | bower_components/ 3 | dist/ 4 | .tmp/ -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (grunt) { 4 | 5 | // Load grunt tasks automatically 6 | require('load-grunt-tasks')(grunt); 7 | 8 | // Time how long tasks take. Can help when optimizing build times 9 | require('time-grunt')(grunt); 10 | 11 | // Configurable paths for the application 12 | var appConfig = { 13 | app: 'tests', 14 | dist: 'dist' 15 | }; 16 | 17 | grunt.loadNpmTasks('grunt-connect-proxy'); 18 | 19 | grunt.loadNpmTasks('grunt-injector'); 20 | 21 | // Define the configuration for all the tasks 22 | grunt.initConfig({ 23 | 24 | // Project settings 25 | yeoman: appConfig, 26 | 27 | injector: { 28 | options: { 29 | ignorePath: 'tests', 30 | addRootSlash: false 31 | }, 32 | local_dependencies: { 33 | files: { 34 | '<%= yeoman.app %>/index.html': ['tests/**/*.js', 'tests/**/*.css'], 35 | } 36 | } 37 | }, 38 | 39 | // Watches files for changes and runs tasks based on the changed files 40 | watch: { 41 | bower: { 42 | files: ['bower.json'], 43 | tasks: ['wiredep'] 44 | }, 45 | js: { 46 | files: ['<%= yeoman.app %>/{,*/}*{,*/}*.js'], 47 | tasks: ['injector','newer:jshint:all'], 48 | options: { 49 | livereload: '<%= connect.options.livereload %>' 50 | } 51 | }, 52 | compass: { 53 | files: ['<%= yeoman.app %>/{,**/}**.{scss,sass}'], 54 | // files: ['<%= yeoman.app %>/styles/main.scss'], 55 | tasks: ['compass:server', 'autoprefixer'] 56 | }, 57 | gruntfile: { 58 | files: ['Gruntfile.js'] 59 | }, 60 | livereload: { 61 | options: { 62 | livereload: '<%= connect.options.livereload %>' 63 | }, 64 | files: [ 65 | '<%= yeoman.app %>/{,*/}*{,*/}*.html', 66 | '.tmp/styles/{,*/}*.css', 67 | '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' 68 | ] 69 | }, 70 | }, 71 | 72 | // The actual grunt server settings 73 | connect: { 74 | options: { 75 | port: 5000, 76 | // Change this to '0.0.0.0' to access the server from outside. 77 | hostname: 'localhost', 78 | livereload: 35728 79 | }, 80 | livereload: { 81 | options: { 82 | open: true, 83 | middleware: function (connect) { 84 | return [ 85 | require('grunt-connect-proxy/lib/utils').proxyRequest, 86 | connect.static('.tmp'), 87 | connect().use( 88 | '/bower_components', 89 | connect.static('./bower_components') 90 | ), 91 | connect.static(appConfig.app) 92 | ]; 93 | } 94 | } 95 | }, 96 | test: { 97 | options: { 98 | port: 9001, 99 | middleware: function (connect) { 100 | return [ 101 | connect.static('.tmp'), 102 | connect.static('test'), 103 | connect().use( 104 | '/bower_components', 105 | connect.static('./bower_components') 106 | ), 107 | connect.static(appConfig.app) 108 | ]; 109 | } 110 | } 111 | }, 112 | dist: { 113 | options: { 114 | open: true, 115 | base: '<%= yeoman.dist %>' 116 | } 117 | } 118 | }, 119 | // Empties folders to start fresh 120 | clean: { 121 | dist: { 122 | files: [{ 123 | dot: true, 124 | src: [ 125 | '.tmp', 126 | '<%= yeoman.dist %>/{,*/}*', 127 | '!<%= yeoman.dist %>/.git*' 128 | ] 129 | }] 130 | }, 131 | server: '.tmp', 132 | styles: '.tmp/styles/scss' 133 | }, 134 | 135 | // Add vendor prefixed styles 136 | autoprefixer: { 137 | options: { 138 | browsers: ['last 1 version'] 139 | }, 140 | dist: { 141 | files: [{ 142 | expand: true, 143 | cwd: '.tmp/styles/', 144 | src: '{,*/}*.css', 145 | dest: '.tmp/styles/' 146 | }] 147 | } 148 | }, 149 | 150 | // Automatically inject Bower components into the app 151 | wiredep: { 152 | options: { 153 | cwd: '<%= yeoman.app %>' 154 | }, 155 | app: { 156 | src: ['<%= yeoman.app %>/index.html'], 157 | ignorePath: /\.\.\// 158 | }, 159 | sass: { 160 | // src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'], 161 | src: ['<%= yeoman.app %>/styles/main.scss'], 162 | ignorePath: /(\.\.\/){1,2}bower_components\// 163 | } 164 | }, 165 | 166 | // Compiles Sass to CSS and generates necessary files if requested 167 | compass: { 168 | options: { 169 | sassDir: '<%= yeoman.app %>/styles', 170 | cssDir: '.tmp/styles', 171 | generatedImagesDir: '.tmp/images/generated', 172 | imagesDir: '<%= yeoman.app %>/images', 173 | javascriptsDir: '<%= yeoman.app %>/scripts', 174 | fontsDir: '<%= yeoman.app %>/styles/fonts', 175 | importPath: './bower_components', 176 | httpImagesPath: '/images', 177 | httpGeneratedImagesPath: '/images/generated', 178 | httpFontsPath: '/styles/fonts', 179 | relativeAssets: false, 180 | assetCacheBuster: false, 181 | raw: 'Sass::Script::Number.precision = 10\n' 182 | }, 183 | dist: { 184 | options: { 185 | generatedImagesDir: '<%= yeoman.dist %>/images/generated' 186 | } 187 | }, 188 | server: { 189 | options: { 190 | debugInfo: true 191 | } 192 | } 193 | }, 194 | 195 | // Renames files for browser caching purposes 196 | filerev: { 197 | dist: { 198 | src: [ 199 | '<%= yeoman.dist %>/scripts/{,*/}*.js', 200 | '<%= yeoman.dist %>/styles/{,*/}*.css', 201 | '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', 202 | '<%= yeoman.dist %>/styles/fonts/*' 203 | ] 204 | } 205 | }, 206 | 207 | // Reads HTML for usemin blocks to enable smart builds that automatically 208 | // concat, minify and revision files. Creates configurations in memory so 209 | // additional tasks can operate on them 210 | useminPrepare: { 211 | html: '<%= yeoman.app %>/index.html', 212 | options: { 213 | dest: '<%= yeoman.dist %>', 214 | flow: { 215 | html: { 216 | steps: { 217 | js: ['concat', 'uglifyjs'], 218 | css: ['cssmin'] 219 | }, 220 | post: {} 221 | } 222 | } 223 | } 224 | }, 225 | 226 | // Performs rewrites based on filerev and the useminPrepare configuration 227 | usemin: { 228 | html: ['<%= yeoman.dist %>/{,**/}*.html'], 229 | css: ['<%= yeoman.dist %>/{,*/}*.css'], 230 | options: { 231 | assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] 232 | } 233 | }, 234 | 235 | // The following *-min tasks will produce minified files in the dist folder 236 | // By default, your `index.html`'s will take care of 237 | // minification. These next options are pre-configured if you do not wish 238 | // to use the Usemin blocks. 239 | // cssmin: { 240 | // dist: { 241 | // files: { 242 | // '<%= yeoman.dist %>/styles/main.css': [ 243 | // '.tmp/styles/{,*/}*.css' 244 | // ] 245 | // } 246 | // } 247 | // }, 248 | // uglify: { 249 | // dist: { 250 | // files: { 251 | // '<%= yeoman.dist %>/scripts/scripts.js': [ 252 | // '<%= yeoman.dist %>/scripts/scripts.js' 253 | // ] 254 | // } 255 | // } 256 | // }, 257 | uglify: { 258 | options: { 259 | mangle: false 260 | } 261 | }, 262 | // concat: { 263 | // dist: {} 264 | // }, 265 | 266 | imagemin: { 267 | dist: { 268 | files: [{ 269 | expand: true, 270 | cwd: '<%= yeoman.app %>/images', 271 | src: '{,*/}*.{png,jpg,jpeg,gif}', 272 | dest: '<%= yeoman.dist %>/images' 273 | }] 274 | } 275 | }, 276 | // imagemin: { 277 | // dist: { 278 | // files: [{ 279 | // expand: true, 280 | // cwd: '<%= yeoman.app %>/images', 281 | // src: '{,*/}*.{png,jpg,jpeg,gif}', 282 | // dest: '<%= yeoman.dist %>/images' 283 | // }, 284 | // { 285 | // expand: true, 286 | // cwd: 'bower_components/select2/', 287 | // src: '{,*/}*.{png,jpg,jpeg,gif}', 288 | // dest: '<%= yeoman.dist %>/images/select2' 289 | // }] 290 | // } 291 | // }, 292 | 293 | svgmin: { 294 | dist: { 295 | files: [{ 296 | expand: true, 297 | cwd: '<%= yeoman.app %>/images', 298 | src: '{,*/}*.svg', 299 | dest: '<%= yeoman.dist %>/images' 300 | }] 301 | } 302 | }, 303 | 304 | htmlmin: { 305 | dist: { 306 | options: { 307 | collapseWhitespace: true, 308 | conservativeCollapse: true, 309 | collapseBooleanAttributes: true, 310 | removeCommentsFromCDATA: true, 311 | removeOptionalTags: true 312 | }, 313 | files: [{ 314 | expand: true, 315 | cwd: '<%= yeoman.dist %>', 316 | src: ['*.html', 'views/{,*/}*{,*/}*.html'], 317 | dest: '<%= yeoman.dist %>' 318 | }] 319 | } 320 | }, 321 | 322 | // ngmin tries to make the code safe for minification automatically by 323 | // using the Angular long form for dependency injection. It doesn't work on 324 | // things like resolve or inject so those have to be done manually. 325 | ngmin: { 326 | dist: { 327 | files: [{ 328 | expand: true, 329 | cwd: '.tmp/concat/scripts', 330 | src: '*.js', 331 | dest: '.tmp/concat/scripts' 332 | }] 333 | } 334 | }, 335 | 336 | // Replace Google CDN references 337 | cdnify: { 338 | dist: { 339 | html: ['<%= yeoman.dist %>/*.html'] 340 | } 341 | }, 342 | 343 | // Copies remaining files to places other tasks can use 344 | copy: { 345 | dist: { 346 | files: [{ 347 | expand: true, 348 | dot: true, 349 | cwd: '<%= yeoman.app %>', 350 | dest: '<%= yeoman.dist %>', 351 | src: [ 352 | '*.{ico,png,txt}', 353 | '.htaccess', 354 | '*.html', 355 | 'views/{,*/}*{,*/}*.html', 356 | 'images/{,*/}*.{webp}', 357 | 'fonts/*' 358 | ] 359 | }, { 360 | expand: true, 361 | cwd: '.tmp/images', 362 | dest: '<%= yeoman.dist %>/images', 363 | src: ['generated/*'] 364 | }] 365 | }, 366 | styles: { 367 | expand: true, 368 | cwd: '<%= yeoman.app %>/styles', 369 | dest: '.tmp/styles/', 370 | src: '{,*/}*.css' 371 | } 372 | }, 373 | 374 | // Run some tasks in parallel to speed up the build process 375 | concurrent: { 376 | server: [ 377 | 'compass:server' 378 | ], 379 | test: [ 380 | 'compass' 381 | ], 382 | dist: [ 383 | 'compass:dist', 384 | 'imagemin', 385 | 'svgmin' 386 | ] 387 | } 388 | }); 389 | 390 | 391 | grunt.registerTask('serve', 'Compile then start a connect web server', function (target) { 392 | if (target === 'dist') { 393 | return grunt.task.run(['build', 'connect:dist:keepalive']); 394 | } 395 | 396 | grunt.task.run([ 397 | 'clean:server', 398 | 'wiredep', 399 | 'concurrent:server', 400 | 'autoprefixer', 401 | 'clean:styles', 402 | 'injector', 403 | 'configureProxies:server', 404 | 'connect:livereload', 405 | 'watch' 406 | ]); 407 | }); 408 | 409 | grunt.registerTask('build', [ 410 | 'clean:dist', 411 | 'wiredep', 412 | 'useminPrepare', 413 | 'concurrent:dist', 414 | 'autoprefixer', 415 | 'concat', 416 | 'ngmin', 417 | 'copy:dist', 418 | 'cdnify', 419 | 'cssmin', 420 | 'uglify', 421 | 'filerev', 422 | 'usemin' //, 423 | // 'htmlmin' 424 | ]); 425 | 426 | grunt.registerTask('default', [ 427 | 'newer:jshint', 428 | 'test', 429 | 'build' 430 | ]); 431 | }; 432 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ghostboyzone 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular-Simditor 2 | 3 | Angular Editor for [simditor](https://github.com/mycolorway/simditor) 4 | 5 | # Demo 6 | [http://ghostboyzone.github.io/angular-simditor/](http://ghostboyzone.github.io/angular-simditor/) 7 | 8 | [![screenshot](http://ghostboyzone.github.io/angular-simditor/demo.png)](http://ghostboyzone.github.io/angular-simditor/) 9 | # Bower Install 10 | bower install angular-simditor --save 11 | 12 | # 用法 13 | 14 | angular.module('app', ['angular-simditor']) 15 | 16 | 17 | 18 | // editorModel就是编辑器对应的富文本的值 19 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-simditor", 3 | "version": "0.1.1", 4 | "homepage": "https://github.com/ghostboyzone/angular-simditor", 5 | "authors": [ 6 | "ghostboyzone " 7 | ], 8 | "description": "Simditor's AngularJS Version", 9 | "main": "src/angular-simditor.js", 10 | "keywords": [ 11 | "angular", 12 | "simditor" 13 | ], 14 | "license": "MIT", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests" 21 | ], 22 | "dependencies": { 23 | "angular": ">=1.2.0", 24 | "simditor": "~2.1.*", 25 | "simditor-html": "mycolorway/simditor-html#~1.0.0" 26 | }, 27 | "overrides": { 28 | "simditor-html": { 29 | "main": [ 30 | "lib/simditor-html.js", 31 | "styles/simditor-html.css" 32 | ] 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-simditor", 3 | "version": "1.0.0", 4 | "description": "Angular Editor for [simditor](https://github.com/mycolorway/simditor)", 5 | "main": "index.js", 6 | "devDependencies": { 7 | "grunt": "^0.4.1", 8 | "grunt-autoprefixer": "^0.7.3", 9 | "grunt-concurrent": "^0.5.0", 10 | "grunt-connect-proxy": "^0.2.0", 11 | "grunt-contrib-clean": "^0.5.0", 12 | "grunt-contrib-compass": "^1.0.1", 13 | "grunt-contrib-concat": "^0.4.0", 14 | "grunt-contrib-connect": "^0.7.1", 15 | "grunt-contrib-copy": "^0.5.0", 16 | "grunt-contrib-cssmin": "^0.9.0", 17 | "grunt-contrib-htmlmin": "^0.3.0", 18 | "grunt-contrib-imagemin": "^0.9.4", 19 | "grunt-contrib-jshint": "^0.10.0", 20 | "grunt-contrib-uglify": "^0.4.0", 21 | "grunt-contrib-watch": "^0.6.1", 22 | "grunt-filerev": "^0.2.1", 23 | "grunt-google-cdn": "^0.4.0", 24 | "grunt-injector": "^0.6.0", 25 | "grunt-karma": "^0.8.3", 26 | "grunt-newer": "^0.7.0", 27 | "grunt-ngmin": "^0.0.3", 28 | "grunt-svgmin": "^0.4.0", 29 | "grunt-usemin": "^2.1.1", 30 | "grunt-wiredep": "~1.8.0", 31 | "jshint-stylish": "^0.2.0", 32 | "karma": "^0.12.21", 33 | "karma-jasmine": "^0.1.5", 34 | "karma-phantomjs-launcher": "^0.1.4", 35 | "load-grunt-tasks": "^0.4.0", 36 | "spawn-sync": "^1.0.11", 37 | "time-grunt": "^0.3.1", 38 | "try-thread-sleep": "^1.0.0" 39 | }, 40 | "engines": { 41 | "node": ">=0.10.0" 42 | }, 43 | "directories": { 44 | "test": "tests" 45 | }, 46 | "scripts": { 47 | "test": "echo \"Error: no test specified\" && exit 1" 48 | }, 49 | "repository": { 50 | "type": "git", 51 | "url": "https://ghostboyzone@github.com/ghostboyzone/angular-simditor.git" 52 | }, 53 | "author": "", 54 | "license": "ISC", 55 | "bugs": { 56 | "url": "https://github.com/ghostboyzone/angular-simditor/issues" 57 | }, 58 | "homepage": "https://github.com/ghostboyzone/angular-simditor" 59 | } 60 | -------------------------------------------------------------------------------- /src/angular-simditor.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | (function() { 4 | var ngSimditor = angular.module('angular-simditor', []); 5 | ngSimditor.constant('simditorConfig', { 6 | placeholder: '这里输入文字...', 7 | toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment', '|', 'html'], 8 | pasteImage: true, 9 | defaultImage: '', 10 | upload: { 11 | url: '/upload' 12 | }, 13 | allowedTags: ['br', 'a', 'img', 'b', 'strong', 'i', 'u', 'font', 'p', 'ul', 'ol', 'li', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'hr', 'div', 'script', 'style'] 14 | }); 15 | ngSimditor.directive('ngSimditor', ['$timeout', 'simditorConfig', function($timeout, simditorConfig) { 16 | // Runs during compile 17 | return { 18 | // name: '', 19 | // priority: 1, 20 | // terminal: true, 21 | scope: { 22 | content: '=' 23 | }, // {} = isolate, true = child, false/undefined = no change 24 | // controller: function($scope, $element, $attrs, $transclude) {}, 25 | // require: 'ngModel', // Array = multiple requires, ? = optional, ^ = check parent elements 26 | restrict: 'E', // E = Element, A = Attribute, C = Class, M = Comment 27 | template: '', 28 | // templateUrl: '', 29 | replace: true, 30 | // transclude: true, 31 | // compile: function(tElement, tAttrs, function transclude(function(scope, cloneLinkingFn){ return function linking(scope, elm, attrs){}})), 32 | link: function($scope, iElm, iAttrs, controller) { 33 | var editor = new Simditor( 34 | angular.extend({textarea: iElm}, simditorConfig) 35 | ); 36 | 37 | var nowContent = ''; 38 | 39 | $scope.$watch('content', function(value, old){ 40 | if(typeof value !== 'undefined' && value != nowContent){ 41 | editor.setValue(value); 42 | } 43 | }); 44 | 45 | editor.on('valuechanged', function(e){ 46 | if($scope.content != editor.getValue()){ 47 | $timeout(function(){ 48 | $scope.content = nowContent = editor.getValue(); 49 | }); 50 | } 51 | }); 52 | } 53 | }; 54 | }]); 55 | })(); 56 | }).call(this); 57 | -------------------------------------------------------------------------------- /tests/angular-simditor.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | (function() { 4 | var ngSimditor = angular.module('angular-simditor', []); 5 | ngSimditor.constant('simditorConfig', { 6 | placeholder: '这里输入文字...', 7 | toolbar: ['title', 'bold', 'italic', 'underline', 'strikethrough', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment', '|', 'html'], 8 | pasteImage: true, 9 | defaultImage: '', 10 | upload: { 11 | url: '/upload' 12 | }, 13 | allowedTags: ['br', 'a', 'img', 'b', 'strong', 'i', 'u', 'font', 'p', 'ul', 'ol', 'li', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'hr', 'div', 'script', 'style'] 14 | }); 15 | ngSimditor.directive('ngSimditor', ['$timeout', 'simditorConfig', function($timeout, simditorConfig) { 16 | // Runs during compile 17 | return { 18 | // name: '', 19 | // priority: 1, 20 | // terminal: true, 21 | scope: { 22 | content: '=' 23 | }, // {} = isolate, true = child, false/undefined = no change 24 | // controller: function($scope, $element, $attrs, $transclude) {}, 25 | // require: 'ngModel', // Array = multiple requires, ? = optional, ^ = check parent elements 26 | restrict: 'E', // E = Element, A = Attribute, C = Class, M = Comment 27 | template: '', 28 | // templateUrl: '', 29 | replace: true, 30 | // transclude: true, 31 | // compile: function(tElement, tAttrs, function transclude(function(scope, cloneLinkingFn){ return function linking(scope, elm, attrs){}})), 32 | link: function($scope, iElm, iAttrs, controller) { 33 | var editor = new Simditor( 34 | angular.extend({textarea: iElm}, simditorConfig) 35 | ); 36 | 37 | var nowContent = ''; 38 | 39 | $scope.$watch('content', function(value, old){ 40 | if(typeof value !== 'undefined' && value != nowContent){ 41 | editor.setValue(value); 42 | } 43 | }); 44 | 45 | editor.on('valuechanged', function(e){ 46 | if($scope.content != editor.getValue()){ 47 | $timeout(function(){ 48 | $scope.content = nowContent = editor.getValue(); 49 | }); 50 | } 51 | }); 52 | } 53 | }; 54 | }]); 55 | })(); 56 | }).call(this); 57 | -------------------------------------------------------------------------------- /tests/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | angular.module('ghostapp', [ 5 | 'angular-simditor' 6 | ]) 7 | .config(['simditorConfig',function(simditorConfig) { 8 | simditorConfig.placeholder = '这里输入文字...'; 9 | }]) 10 | .controller('TestCtrl', ['$scope', function($scope){ 11 | $scope.test = 'test content'; 12 | }]); -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | {{ test }} 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /tests/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ghostboyzone/angular-simditor/0b78c717553130a5bb3501ddbae22debca9a88b4/tests/test.jpg --------------------------------------------------------------------------------