title: How to I allow textbox to accept pattern from 0-6 and X in its input with maxlength 6?
body: <p>I have a textbox which will only accept numbers from 0-6 and alphabet 'X' (0,1,2,3,4,5,6,X) and maxlength 6. How to do that in angular?</p>
  
  <pre><code>&lt;tr *ngFor="let lists of resObj;let i = index"&gt;
          &lt;td&gt;
          &lt;input type="number" [(ngModel)]="lists.from" (ngModelChange)="onHandle($event, 'from', lists)" maxlength="1"
                            onKeyPress="if(this.value.length===2) return false;"
                            onKeyUp="if(this.value&gt;6){this.value=6;}else if(this.value&lt;0){this.value=0;}" /&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>