有人可以解释一下角度能力的逻辑能否在按钮上没有ng-model的情况下检测范围内的Kendo点击事件?
<kendo-button on-click="clickWithoutNgModel()">Button</kendo-button>
$scope.clickWithoutNgModel = function () {
alert("Clicked without using ng-model on the button");
} // this works - how?
答案 0 :(得分:1)
创建Kendo小部件时,Kendo代码会将clickWithoutNgModel
函数绑定为Kendo Button小部件中click event的事件处理程序。为此,它使用$scope.$eval
从作用域中获取函数,然后在触发click事件时调用它。