title: How to add form validation pattern in Angular 2?
body: <p>I have a simple form that needs to validate if the beginning and the end of the input is not space.</p>
  
  <p>In HTML5, I will do this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input type="text" pattern="^(?!\s|.*\s$).*$"&gt;
  </code></pre>
  
  <p>What is the right property for validation pattern in the new Angular 2 ngControl directive? The official Beta API is still lacking documentation on this issue.</p>