There must a requirement in any application to allow only entering numbers in text inputs. This can be solved by creating a directive with onKeydown event handler. And then adding this directive to input element. See below code sample. We add this directive to input element like below. When user tries to enter value otherContinue reading “Restrict user from entering non-numeric inputs using a directive in Angular.”