AngularJS Text – Allow Numeric Only2 min read

In this blog, I will demonstrate how to allow only numeric values in input textbox, using AngularJS. This technique is most useful for quantity and countable input text.

HTML Code

I have designed a simple input type “Text” in HTML.using AngularJS.

AngularJS Code

Create an Angular module and name it as  “csharpcor”.

Create Angular Controller for initiating the value.

Module and Controller name must assign to the HTML element.

Create Angular directives as given below.


 

Assgin a directive to the input text.


 

Author Profile

Thiruppathi Rengasamy
I 'm a .Net Developer & Blogger. And also I'm working as senior software engineer in Microsoft Technologies for 5+ Years.I would like to spend my precious time in writing articles, research in .Net technologies and to learn new technologies.

Hits: 17