title: Nativescript Observable.propertyChangeEvent
body: <p>I am trying to create some customer formatting on a field (to reproduce a masked text box functionality).</p>
  
  <p>I have an observable and I am capturing the propertyChange Event.  My question is:  Can I modify the value of the observed property inside the event handler without entering in an infinite loop?</p>
  
  <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>model.customer.addEventListener(Observable.propertyChangeEvent, function(data) {
   if (data.propertyName.toString() === 'homePhone') {
        //Here is where I would like to change the value without triggering the event again
        //The below code does not seem to be working
     data.value = formatPhone(data.value);
   }
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I looked at <a href="https://github.com/bthurlow/nativescript-maskedinput" rel="nofollow">https://github.com/bthurlow/nativescript-maskedinput</a>, but unfortunately this module does not support databinding.</p>
  
  <p>Thank you.  Appreciate your help.</p>