Sep 17, 2020

Display Form Content In Angular -Example 1

In this example we will discussing and learn about angular form content, and how to display form content without page refresh.

First need to import "angular.min.js" in script.

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

Example:

<!DOCTYPE html>
 
<html>
 
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
 
<body>
 

 
<div ng-app="">
 

 
<p>Enter Text: <input type="text" ng-model="text1"></p>
 
<p>Your Text Which You Entered: {{ text1 }}</p>
 

 
</div>
 

 
</body>
 
</html>

Output:

Explanation:

ng-app: This directory defines an AngularJS application.

ng-model: he ng-model directive binds the value of HTML controls (input, select, textarea) to application data.