This code sample are used to validate a phone number using ng- required, ng-pattern, ng- minlength and ng- maxlength which are given below in detail. Table of Contents. input type is equal to text i.e. [type="text"]. Used to required element. Used to ng-pattern attribute. Used to minlength and maxlength . place-holder control etc.. Example code as given below. <! doctype html > < html > < head > < title > angularjs phone number validation </ title > < script src ="http://code.angularjs.org/1.2.9/angular.min.js"></ script > < style > .error { color : red ; } </ style > < script > var app = angular.module( 'myApp' , []); app.controller( 'mainCtrl' , function ($scope) { ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers