title: Filter input with directive
body: <p>html</p>
  
  <pre><code>&lt;input type="text" name="usernr" ng-model="userNr" placeholder="user nr"
                                 tabindex="2" ng-usernumber/&gt;
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>app.directive('ngUserNumber', function() {
              return {
                  restrict: 'A',
                  require: 'ngModel',
                  link: function(scope, elm, attrs, ctrl) {
                      console.log("inside directive");
                      ctrl.$parsers.push(function(data) {
                          console.log("//convert data from view format to model format");
  
                          data = data.toString() + " test";
  
                          return data; //converted
                      });
  
                      ctrl.$formatters.push(function(data) {
                          console.log("//convert data from model format to view format");
  
                          data = data.toString() + " test";
  
                          return data; //converted
                      });
                  }
              };
          });
  </code></pre>
  
  <p>I would like to replace the data provided by ng-model, with data from inside the directive. But nothing happens. How come the custom directive isn't used? </p>
  
  <p>I followed this doc: <a href="http://www.ng-newsletter.com/posts/directives.html" rel="nofollow noreferrer">http://www.ng-newsletter.com/posts/directives.html</a> <br>
  other source: <a href="https://stackoverflow.com/a/15346236/489856">https://stackoverflow.com/a/15346236/489856</a></p>