title: How to remove leading and trailing white spaces from input text?
body: <p>I need to fix a bug in AngularJS application, which has many forms to submit data-</p>
  
  <p>Every Text box in forms is accepting whitespaces(both leading and trailing) and saving them into the database. So in order to fix this I used <code>ng-trim="true"</code>, it worked and data is getting saved correctly in the back-end.</p>
  
  <p>Problem: Even after using ng-trim when I click on save/update, the form UI shows the text with white-spaces not the trimmed data. It shows correct data only when I refresh the page.</p>
  
  <p>Can anyone guide me.. what will be the approach to fix this?</p>
  
  <p>P.S. - I'm new to both JavaScript and Angular!</p>
  
  <p>Thanks</p>