Follow the steps below to create an AngularJS application
Step 1: Loading the Frame
As a pure JavaScript framework, it can be added using the <script> tag.
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
Step 2: Define AngularJS application using the ng-app directive
<div ng-app="">...</div>
Step 3: The pattern name defined with the ng-model directive
<p>Enter your Name: <input type="text" ng-model="name"></p>
Step 4: Use the ng-bind directive to bind the value definition in the above model
<p>Hello <span ng-bind="name"></span>!</p>
Follow the steps below to run the AngularJS application
Use the three steps mentioned above in the HTML page.
testAngularJS.html
<html><title>AngularJS First Application</title><body><h1>Sample Application</h1><div ng-app=""> <p>My name: <input type="text" ng-model="name"></p> <p>Hello, <span ng-bind="name"></span>!</p></div><script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script></body></html>
Output
Open textAngularJS.html in a web browser. Please enter your name and see the results.
How to integrate AngularJS with HTML
The ng-app directive indicates the start of the AngularJS application.
The ng-model directive creates a model variable named "name" in the HTML page, and has the ng-app directive used in the div.
ng-bind uses the model name as long as the user enters something in the text box is displayed in the HTML span tag.
The end</div> tag indicates the end of the AngularJS application.
The above is the simple AngularJS application. We will continue to organize relevant information in the future. Thank you for your support for this website.