天天看點

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

繼續閱讀