What is $$phase in AngularJS?

后端 未结 5 1903
名媛妹妹
名媛妹妹 2020-12-01 04:20

I found this code snippet which is part of a angular directive someone wrote for bootstrap modal.

//Update the visible value when the dialog is closed                


        
5条回答
  •  鱼传尺愫
    2020-12-01 04:42

    my understanding is it is good to use when digesting or applying the scope. If it is truthy it means that there is currently a $digest or $apply phase in progress. If you are getting related errors you can do $scope.$$phase || $scope.digest(); which will only digest if $scope.$$pahse is falsy.

提交回复
热议问题