天天看点

When should reread of cl_crm_bol_entity and $scope.$apply be called manually

CL_CRM_BOL_ENTITY~REREAD

When should reread of cl_crm_bol_entity and $scope.$apply be called manually

CHECK line 35, scan lv_do_reread to know the logic of its assignment.

When should reread of cl_crm_bol_entity and $scope.$apply be called manually

reread will not be triggered until this flag is set as true.

s c o p e . scope.scope.apply in Angular

When we should call s c o p e . scope.scope.apply manually?

看一个实际例子:第14行的div绑定到了angular的模型字段message。

该应用启动后,屏幕显示第6行绑定的值:Waiting 2000ms for update。

然后启动第7行的setTimeout定时器,2秒后,执行定时器的回调函数, 在第8行将模型字段的值改成"Timeout called".

When should reread of cl_crm_bol_entity and $scope.$apply be called manually

然而,在浏览器上我们没有观察到期望中的页面刷新,UI仍然显示Waiting 2000ms for update,而不是我们期望的Timeout called。

Solution:

When should reread of cl_crm_bol_entity and $scope.$apply be called manually
When should reread of cl_crm_bol_entity and $scope.$apply be called manually

继续阅读