Flat 10% & upto 50% off + 10% Cashback + Free additional Courses. Hurry up

What is AngularJS Forms?

A Form is a set of controls for the purpose of grouping related controls together that means it is a collection of input controls. Controls like input, select, textarea are the ways for a user to enter data. Form and controls give validation services so that the user can be informed of invalid input before submitting a form.


<!DOCTYPE html>

<html lang="en">

<script src= ""></script>


<div ng-app="formApp" ng-controller="formCtrl">


First Name:<br>

<input type="text" ng-model="user.Name"><br>

<button ng-click="reset()">Reset</button>


<p>user = {{user}}</p>

<p>master = {{master}}</p>



var app = angular.module('formApp', []);

app.controller('formCtrl', function($scope) {

$scope.master = {Name:"abc"};

$scope.reset = function() {

$scope.user = angular.copy($scope.master);









In this example,

ng-app –It defines the AngularJS application.

ng-model – Connect the values of application data to HTML input controls.

ng-controller – It defines the application controller.

formCtrl – This function puts initial values to the master object and describes the reset() method.

reset() – This method puts the user object equal to the master object.

ng-click – It calls the reset() method only if the button is clicked.

Attribute novalidate can also used with form to override HTML5 validation.

Previous Next

Download Interview Questions asked by top MNCs in 2019?

"0 Responses on AngularJS Forms"

    100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

    Sales Offer

    Sign Up or Login to view the Free AngularJS Forms.