title: AngularJs or JavaScript Wait For Some Condition
body: <p>At one line of my code I have something like that:</p>
  
  <pre><code>...
  while(!$scope.isMyTurn(privilege)){}
  I will run next line of codes
  </code></pre>
  
  <p>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.</p>
  
  <p>This is for refreshing a graphic until my turn is come.</p>