title: Angular: how to destroy a promise
body: <p>In my word-cloud application I have 2 directives, a word cloud directive and table directive that when a word in the word cloud is selected, it notify to the table so the table will also select the correspond word. The word-cloud and the table communicate by promise which resides in the service, and I want to destroy the promise:</p>
  
  <p><strong>service code:</strong> </p>
  
  <pre><code>this.selectedDefferd = $q.defer(); 
  
  this.selectedPromise = this.selectedDefferd.promise;
  
     notifySelect(id)
     {
          this.selectedDefferd.notify({newData: this.data[id]});
      }
  
   setSelect(callBack) {
      this.selectedPromise.then(null, null, callBack);
  }
  </code></pre>
  
  <p><strong>word cloud directive code :</strong></p>
  
  <pre><code>d3.select(this).on("click", function (d) {
  ...
  ctrl.wordService.notifySelect(d.id);
  }
  </code></pre>
  
  <p><strong>table directive</strong></p>
  
  <pre><code>var selectCallback = $(".selected");
  
  wordService.setSelect(selectCallback);
  </code></pre>
  
  <p>Thanks  in advance,</p>
  
  <p>Harel</p>