title: Component is detached while registration of scope-based event listener is in progress
body: <pre class="lang-html prettyprint-override"><code>&lt;form&gt;
      ...
      &lt;button ng-click...&gt;Save&lt;/button&gt;
  &lt;/form&gt;
  &lt;overlay ng-if="saving" style="background-color: #ff0000"&gt;
      &lt;pindicator size="2em" color="red"&gt;&lt;/pindicator&gt;
  &lt;/overlay&gt;
  </code></pre>
  
  <pre class="lang-dart prettyprint-override"><code>void handleOnSaveClicked(final html.Event e) {
      _logger.info("Ready to save:",_tempJob);
  
      saving = true;
  
      // Angular starts to register Listener
  
      _proxy.save(tempJob).then((_) {
          // Template/Component has already received "detach" 
  
          _logger.info("Job saved!");
          editable = false;
          saving = false;
      });        
  }
  ...
  void detach() {
      _logger.info("Detached!");
  }
  </code></pre>
  
  <p>proxy.save saves tempJob into a list, this list is observed by Angular.
  If this list changes Angular updates all the UI-Elements attached to the list.</p>
  
  <p>saving=true should show a message but if proxy.save is so fast that Angular has no chance to register a Listener for "saving" (<a href="https://github.com/angular/angular.dart/blob/master/lib/core/scope.dart" rel="nofollow">https://github.com/angular/angular.dart/blob/master/lib/core/scope.dart</a> - Line 352). the whole UI-Block is remove while Angular tries to register the Listener.</p>
  
  <p>This leads to <br></p>
  
  <pre><code>JobEdit: (15:19:43.096) Ready to save:
  JobEdit: (15:19:43.119) Job saved!
  JobEdit: (15:19:43.123) Detached!
  'package:angular/core/scope.dart': Failed assertion: line 352 pos 12: 'isAttached' is not true.
  </code></pre>
  
  <p>Any hints to avoid this kind of "race condition"?</p>