AngularJS Text – Allow Numeric Only

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.


 

Related Posts

  • 87
    In this blog, I will demonstrate input textbox, set comma separator, using AngularJS and most useful for quantity and countable input text. HTML code I…
    Tags: input, angularjs, div, html, /div, return, code, module, text, type="text
  • 59
    Introduction This article demonstrates how to learn MVC using Angular Summernote in Visual Studio 2017. Following are the steps you can use to create an…
    Tags: angular, will, angularjs
  • 49
    If your Development team still using AngularJS, This news for you... Currently we can use AngularJS Version 1.6 from angularjs.org. Recently they are planning one more release…
    Tags: angularjs, will, angular
  • 47
    Introduction In this article, we will learn MVC using Angular Wizard and Datatable from the server side, and work with the stored procedure using Visual…
    Tags: create, div, /div, angularjs
  • 41
    Angular is considered one of the best open-source JavaScript frameworks. Google’s Angular team released Angular 2 as a complete makeover of its original Angular 1…
    Tags: angular
Show Buttons
Hide Buttons