Code Monkey home page Code Monkey logo

angular-kindeditor's Introduction

angular-kindeditor

angular-kindeditor是整合kindeditor的富文本编辑器插件,我们在项目中可以随处使用,非常方便

Note:仅兼容1.x

修复日志:

  1. 解决高版本不兼容问题
  2. 解决初始化内容不显示问题

Demo

http://zedwang.github.io/angular-kindeditor

demo

Install

$ bower install ngKeditor

构建

第一步:

    ~ npm install

第二步:

    ~ grunt

准备

先引入kindeditor的配置文件

<script src="kindeditor/kindeditor-all-min.js"></script>

然后把angular-kindeditor插件引入进来:

<script src="angular-kindeditor.js"></script>

还没完,在声明模块的地方把ngKeditor注入进去:

var app = angular.module("demoApp",['ngKeditor']);

使用

因为我们的插件是继承ngmodel的,所以我们必须要绑定model,然后写上我们默认命名的指令

<div keditor ng-model="content"></div>

如果要自定义配置,按照下面的格式做就OK了

<div keditor ng-model="content" data-config="config"></div>

<script>
    $scope.config = {
        width:'100px'
    }

</script>
<div keditor ng-model="content" data-pattern="reg"></div>

<script>
    $scope.reg = /\d+/g;
    // input 123/hello
    // output true/false;
</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.