title: ANGULAR2: Detecting Change in static variable of a class
body: <p>I am writing a dragDirective. Eements are dragged in dragZones. On mouse releases I do a hitTest against all availabe dragZones. I am maintaining a static boolean flag which ends up being false if all hittests return false. In such a situation I would like to resposition the element in the dragZone it originally belonged to. How do I check against this change in variable value?</p>
  
  <pre><code>    this._messageBus.listen("dragStart", (obj, event) =&gt; {
          DragZoneDirective.HITTEST = false;
      }); 
      this._messageBus.listen("dragStop", (obj, event) =&gt; {
          if (this.hitTest(event.x, event.y))
          {
              //clone object
              let clone: Object = JSON.parse(JSON.stringify(obj));
              this.dragZoneElems.push(clone);
              DragZoneDirective.HITTEST = true;
          }
  
          let index = this.dragZoneElems.indexOf(obj);
          if (index &gt; -1)
              this.dragZoneElems.splice(index, 1);
      });
  </code></pre>