What is $$phase in AngularJS?

后端 未结 5 1882
名媛妹妹
名媛妹妹 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 05:01

    $$phase is a flag set while angular is in a $digest cycle.

    Sometimes (in rare cases), you want to check $$phase on the scope before doing an $apply. An error occurs if you try to $apply during a $digest:

    Error: $apply already in progress

提交回复
热议问题