At one line of my code I have something like that:
...
while(!$scope.isMyTurn(privilege)){}
I will run next line of codes
However as usual it blocks my browser. I have to wait until get true to run next line of codes. I don't want to block my browser and other functionalities should work because(some of other fired events will change the situation of my turn) User should continue whatever he does.
This is for refreshing a graphic until my turn is come.