-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
58 lines (53 loc) · 1.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!--
@license AngularJS v1.2.9
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
Created by Zed on 19-11-2014.
-->
<!DOCTYPE html>
<html ng-app="demoApp">
<head lang="en">
<meta charset="UTF-8">
<title>angular整合kindeditor富文本编辑器demo</title>
<style>
.right {
color: #008000;
}
.error {
color: #ff0000;
}
</style>
</head>
<body ng-controller="kindeditorCtrl">
<div style="width: 80%; margin: 0 auto">
<form action="" name="myForm">
<textarea class="keditor" ng-model="info.content" data-config="config" cols="30" rows="10" required></textarea>
</form>
<p><span style="color: red">ng-model:</span>{{info.content}}</p>
<p><span style="color: #ff0000">必填项myForm.$valid:</span>{{myForm.$valid}} </p>
<p ng-hide="myForm.$valid" class="error">验证不通过!</p>
<p ng-show="myForm.$valid" class="right">验证通过!</p>
</div>
</body>
<!--<script src="//cdn.bootcss.com/angular.js/1.3.0/angular.min.js"></script>-->
<script src="//cdn.bootcss.com/angular.js/1.4.0/angular.min.js"></script>
<!--<script src="//cdn.bootcss.com/angular.js/1.2.28/angular.min.js"></script>-->
<!--<script src="//cdn.bootcss.com/angular.js/1.2.29/angular.js"></script>-->
<script src="kindeditor/kindeditor-all-min.js"></script>
<script src="kindeditor/lang/zh-CN.js"></script>
<script src="src/angular-kindeditor.js"></script>
<script>
var app = angular.module("demoApp",['ngKeditor']);
app.controller("kindeditorCtrl",["$scope","$interval",function($scope,$interval){
var count = 0;
$interval(function () {
count++;
$scope.info = {
content : count
};
},1000)
$scope.config = {width: '100px'};
$scope.reg = /^\d+/g;
}]);
</script>
</html>