title: angular custom directive to trim spaces works but validation fails
body: <p>In my ionic3 angular application I need to trim the spaces from an email input field while the user is typing. To do so I created a Directive like this:</p>
  
  <pre><code>    @Directive({
    selector: '[no-space]',
    host: {
      "(input)": 'onInputChange($event)'
    }
  })
  export class NoSpaceDirective{
    onInputChange($event){
      $event.target.value = $event.target.value.trim();
    }
  }
  </code></pre>
  
  <p>the directive works, however the validation does not behave correctly: the validation is set to not allow spaces in the value; when I type a space it is trimmed by the directive but the validation fails as if the space is not visible but still there.</p>