简体   繁体   English

Kendo UI按钮切换角度

[英]Kendo UI button swith angular

I have the following example . 我有下面的例子

Two kendo UI buttons and two regular buttons. 两个kendo UI按钮和两个常规按钮。 Both should enable/disable the button on bottom. 两者都应启用/禁用底部的按钮。 Only the regular buttons do and I don't understand why. 只有常规按钮可以使用,我不知道为什么。 Probably has something to do with the scope... 可能与范围有关...

EDIT: 编辑:

From another example I have, it seems like the scope is updated correctly but the ui is not updated. 从另一个例子来看,似乎范围已正确更新,但ui未更新。 In my example i have another control that when I click it the ui is suddenly being updated. 在我的示例中,我还有另一个控件,当我单击它时,UI突然被更新。

Found the answer: 找到了答案:

When clicking the kendo button the scope does change but it doesn't go through angular so angular doesn't know that the scope was changed so the digest cycle doesn't run. 单击“剑道”按钮时,范围会发生变化,但不会通过角度,因此角度不知道范围已更改,因此摘要循环不会运行。 So adding $scope.$apply(); 因此添加$scope.$apply(); at the end of the function triggers the digest. 函数结束时触发摘要。

Took the explanation from here . 这里接受了解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM