This is my custom version of an Angular JS Directive to ensure input values are digits only.
You can then use the directive in the input field like this:
Using ng-pattern regex is good only for validation but does not hinder the user from inputting non-numeric characters so having a directive like this makes it even better to be sure that inputs are numeric only.
Here is a method I found in the Internet made by a certain Dogstopper of dream.in.code where every first letter of a sentence is capitalized using Java. I have my own but it uses Regex so I decided to post this one here for future reference.