mercredi 20 juillet 2016

Angular custom directive for input validation

I,m trying to create simple custom directive in angularJS which validates if user types in an an integer or not.

If the user enters an integer then an error message should appear in the bottom that "integers are not allowed".

Any idea how can i achieve this...? (A fiddle would be awesome)

and also...

Is this possible to do WITHOUT using $scope.$watch ?

Is this a professional and effective way to check for client side input validation ? (does this approach compromises performance of the application) ?

Aucun commentaire:

Enregistrer un commentaire