title: Directive to allow only alphabetic characters in view and model value
body: <p>I am trying to achieve a directive that would be used to accept only alphabets into the text box i.e from a-z or A-z 
  I did try to do this by,</p>
  
  <pre><code> angular.module('myApp', []).directive('alphabetsOnly', function(){
  return {
   require: 'ngModel',
   link: function(scope, element, attrs, modelCtrl) {
     modelCtrl.$parsers.push(function (inputValue) {
  
         if (inputValue == undefined) return '' 
         var transformedInput = inputValue.replace(/^[a-zA-Z]+$/, ''); 
         if (transformedInput!=inputValue) {
            modelCtrl.$setViewValue(transformedInput);
            modelCtrl.$render();
         }         
  
         return transformedInput;         
     });
   }
  };
  });
  
  function MyCtrl($scope) {
  $scope.name = ''
  }
  </code></pre>
  
  <p>but this does not works .</p>
  
  <p>tried with pattern</p>
  
  <pre><code>'/^[a-zA-Z]$/' 
  </code></pre>
  
  <p>but no success. Can anyone help me with this.</p>