This code sample are used to validate a required field with single word which are given below. Table of Contents. input type is equal to text [ type="text" ]. ng-pattern with single word. Required element tag. ng-model with two way binding. Example code <! doctype html > < html > < head > < title > angularjs requiredvalidation </ 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) { $scope.username = '' ; $scope.singl...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers