剑道UI编辑器中的事件Angularjs [英] Kendo UI Editor Events in Angularjs
本文介绍了剑道UI编辑器中的事件Angularjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何从剑道UI编辑器?
How do I get the event properties from the events in Kendo UI Editor?
我从KendoDemo下载采取了code和编辑它一下能为的事件K-ON-变化
和 K-ON-的keydown
。
事件这里描述。
I've taken the code from the KendoDemo download and edited it a bit to get the events for k-on-change
and k-on-keydown
.
The events are described here.
<div id="example" ng-app="KendoDemos">
<div ng-controller="MyCtrl">
<textarea kendo-editor k-ng-model="html" k-on-keydown="keydown(e)" k-on-change="onChange(e)"></textarea>
</div>
</div>
<script>
angular.module("KendoDemos", [ "kendo.directives", "ngSanitize" ])
.controller("MyCtrl", function($scope){
$scope.html = "<h1>Kendo Editor</h1>\n\n" +
"<p>Note that 'change' is triggered when the editor loses focus.\n" +
"<br /> That's when the Angular scope gets updated.</p>";
$scope.onChange = function(e){
console.log('onchange');
console.log(e);
};
$scope.keydown = function(e){
console.log('keydown');
console.log(e);
}
})
</script>
在事件方法输出的onChange和KEYDOWN不给我的电子文档中描述
属性。
The output in the event methods onChange and keyDown don't give me the e
property described in the documentation.
我是什么失踪?
推荐答案
橡胶鸭调试效果...踢
Rubber duck debugging effect kicking in...
找到了我一直在寻找,使用添加所有选项 K-选项
。
Found what I was looking for, add all options using k-options
.
<div id="example" ng-app="KendoDemos">
<div ng-controller="MyCtrl">
<textarea kendo-editor k-ng-model="html" k-options="options"></textarea>
</div>
</div>
<script>
angular.module("KendoDemos", [ "kendo.directives", "ngSanitize" ])
.controller("MyCtrl", function($scope){
$scope.html = "<h1>Kendo Editor</h1>\n\n" +
"<p>Note that 'change' is triggered when the editor loses focus.\n" +
"<br /> That's when the Angular scope gets updated.</p>";
$scope.options = {
change: function(e){console.log(e);},
keydown: function(e){console.log(e);}
};
})
</script>
这篇关于剑道UI编辑器中的事件Angularjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文